Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free
  • By Shane Rosenthal
    Create a Currency Data Type using Custom Casts in Laravel 7 Create a Currency Data Type using Custom Casts in Laravel 7

    Since Laravel version 5.1, as developers have been given the ability to cast attributes on models. Attribute casting provides a convenient method of converting attributes to common data types. Behind the scenes, Laravel actually uses these casts for the created_at and updated_at fields on a typical model. These attributes are cast as a datetime which converts the database timestamp to a Carbon instance. The cast types that we have had at our disposal are integer, real, float, double, string, boolean, object, array, collection, date, and datetime.

    However, with the release of Laravel 7, we have the ability to create our own custom cast types. For example, maybe you have a model that stores the price of a product or subscription as cents along with currency. We can now create a custom cast that will handle storing …

    Read More
  • By Shane Rosenthal
    Intro to Alpine.js with Twilio Verify and Laravel Livewire Intro to Alpine.js with Twilio Verify and Laravel Livewire.png

    Alpine.js is a relatively new front-end framework that promises the reactive and declarative nature of big frameworks like Vue.js or React.js without having to run npm, compile scripts, configure webpack all in a nice 7.37kb cdn hosted file. You get to keep your DOM, and sprinkle in behavior as you see fit. Think of it like Tailwind for JavaScript. After using Alpine on several enterprise projects, I can testify to its ease of use and scalability.

    According to the Alpine.js docs, its syntax is almost entirely borrowed from Vue.js (and by extension Angular.js), so if you already know either of these frameworks there is a very low learning curve to getting started.

    Prerequisites

    Before you begin this tutorial, make sure you have the following set up/installed:

    NOTE: We are leveraging the power of Laravel Livewire for this demo, …

    Read More
  • By Shane Rosenthal
    Quick Introduction to Anonymous Blade Components In Laravel 7 Quick Introduction to Anonymous Blade Components In Laravel 7

    Laravel 7 introduced not only a new syntax for Laravel Blade components, but some awesome new features that can greatly enhance your development by increasing your productivity. This tutorial will provide a brief overview of the new Anonymous components in Laravel 7, by teaching you how to create dynamic, reusable form fields.

    Prerequisites

    Before you begin this tutorial, make sure you have the following set up/installed:

    • A Laravel 7 application already installed
    • General knowledge of Laravel and Blade components

    What We’ll Build

    We’ll put together a simple, profile-like form, and then extract data from the Blade components. I will be using Tailwind CSS for the styling which for your reference, can be brought in through their CDN. Create a new folder and layout located at resources/views/layouts/main.blade.php. Add the following code to the newly created file:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Laravel 7 …
    Read More
  • By Shane Rosenthal
    Create a Phone Dialer App in PHP with Laravel Livewire and Twilio Voice Create a Phone Dialer App in PHP with Laravel Livewire

    Laravel Livewire is a "full-stack framework for Laravel that makes building dynamic interfaces simple, without leaving the comfort of Laravel." You might be used to using frameworks such as Vue.js, React, or another JavaScript framework to manage your front-end data in Laravel, but with Livewire, gone are the days of having to make AJAX requests to your own API to re-render data in the browser. In short, and from personal experience, Livewire will decrease your development time significantly by coupling your front-end with the back-end; it eliminates the need to manage most dependencies with webpack or ingesting your own API.

    Prerequisites

    Before you begin this tutorial, make sure you have the following set up/installed:

    What We’ll Build

    What better way to demonstrate the power …

    Read More
  • By Shane Rosenthal
    DRY Up Your HTML With Laravel 7 Blade Components DRY Up Your HTML With Laravel 7 Blade Components

    In the latest iteration of Laravel, developers were introduced to a new syntax for creating Blade Components. If you’re unfamiliar, a blade is the templating engine in Laravel that allows you to use plain PHP in your view. The components, or reusable code created using this logic, allows you to easily follow the DRY or “Don’t Repeat Yourself” principle. Creating a Blade component once means that you can reuse the code anywhere in your application.

    Twitter screenshot

    The improvements made in Laravel 7 promise to speed up your development time by allowing you to create new, class-based Blade components for your front end markup.

    Previous Implementations of Blade Components

    Since Laravel 5.4, developers have h …

    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.