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

PHP posts

  • 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 Ladapo Samuel
    Send an Email Using Twilio SMS in PHP with SendGrid Send an Email Using Twilio SMS in PHP with SendGrid.png

    One of the most amazing and forgotten features of SMS is that it works with no internet access. If you’re one of the 3.5 billion people in the world that uses a smartphone, you might not be aware of the millions that don’t use their finger to swipe their screens. India alone accounts for 400 million feature phones still in use in the world.

    This might be hard to imagine, but assume you’re in a tight situation and you need to send a quick email and have no internet access. Maybe it’s a job posting you saw or an opportunity that can’t wait until you reach your laptop. It would be helpful if you could still send an email using SMS! In this tutorial, we’re going to learn how to do just that; send email using SMS.

    Technical Requirements

    Your computer will need to be set up to with …

    Read More
  • By Ugendu Ositadinma
    Create a Twilio Voice Pricing Calculator using PHP Create a Twilio Voice Pricing Calculator using PHP

    A major concern when building web solutions with third-party services is estimating the costs of API requests. This tutorial will guide you through the process of finding the costs of voice calls for Twilio Programmable Voice, depending on the origin and destination.

    Installation Requirements

    Getting started with this tutorial, it is expected that you have the following modules/packages installed on your development machine:

    Here is a guide that can be followed to  install Composer globally:

    Creating the PHP project

    Let’s create a folder named pricing on your local machine where the code will be housed.

    Inside this folder, create an index.php file which will contain all the code for this tutorial.

    Next, proceed to install Twilio's PHP SDK to call the necessary APIs needed for the functions to be shared. To achieve this, use Composer to install …

    Read More
  • By Chimezie Enyinnaya
    Build A Group Chat With Admin Moderation In Laravel Using Twilio Programmable Chat Build A Group Chat With Admin Moderation In Laravel Using Twilio Programmable Chat

    In this tutorial, I’ll be showing you how to build a Laravel group chat application with admin moderation using Twilio Programmable Chat.

    Prerequisites

    In order to follow this tutorial, you will need the following:

    What We’ll Be Building

    For the purpose of this tutorial, we’ll be building a group chat, where an admin will be able to perform the following tasks:

    • Ban members in a group
    • Unban members in a group
    • Remove members from a group

    Getting Twilio Credentials

    Login to your Twilio dashboard and copy both your Account SID …

    Read More
  • By Michael Okoko
    Forward Twilio Application Errors to Slack with Bref PHP Forward Twilio Application Errors to Slack with Bref PHP

    Serverless applications are applications that are built, deployed, and then executed on-demand. The servers on which they run are provided by the cloud platform to which they are deployed, and the developer only needs to focus on writing the code.

    The on-demand aspect ensures that the developer is only charged for execution time, as opposed to being charged for a fixed amount of bandwidth or a specific number of servers.

    Bref is an open-sourced project that lets you create and deploy serverless applications, called functions, to AWS Lambda using PHP. It integrates with the Serverless Framework which abstracts the operations involved in deploying and monitoring such applications.

    In this tutorial, you will be building a webhook for the Twilio Console Debugger that gets triggered when there is an error with (any of) your Twilio application(s) and send the payload to Slack.

    Prerequisites

    To follow along, you will need:

    • PHP 7.2 …
    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 Alex Dunne
    How to Build an Automated Lone Worker System in PHP using Symfony Workflow & Twilio How to Build an Automated Lone Worker System in PHP using Symfony Workflow & Twilio

    Automated lone worker systems are imperative for companies that have employees tasked with working in high-risk environments by themselves. In fact, the employer holds a duty of care to ensure that these employees are safe while they work.

    Lone worker systems can take many forms. Such forms include apps downloaded on the lone worker’s phone or physical devices to be worn by the lone worker at all times.

    In this tutorial, we’re going to look at how we can combine Symfony and it’s Messenger and Workflow Components, along with Twilo’s Programmable Voice and SMS APIs to implement an automated lone worker check-in system.

    Throughout the tutorial we’ll cover:

    • How to use Twilio’s PHP SDK to make outbound calls and receive input from the user via Twilio’s Voice API
    • The basics of state machines and how to implement one with Symfony Workflow
    • How to configure and dispatch delayed asynchronous messages with …
    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
  • By Marcus Battle
    Custom Laravel 7 Email Verification with Twilio Verify and SendGrid Custom Laravel 7 Email Verification with Twilio Verify and SendGrid

    When you allow users to register with your application without verifying their email addresses, you decrease the likelihood of being able to contact them again. If they’re allowed to sign up with an incorrect email address, there’s no guarantee that they’ll navigate to their profile and fix it later.

    Email verification exists to correct this user experience flaw. When implemented correctly, email verification allows a user to sign up and receive a secure token sent to their email to confirm that they’re both real and have provided the correct email address.

    By adding verification to any step of your user‘s journey, Twilio Verify allows you to fight fraud before it starts and verify users with email, SMS, or voice.

    In this tutorial, you’ll be using Twilio Verify and SendGrid to override the default verification logic in Laravel and roll out your own system.

    It’s important to note that Laravel comes …

    Read More
  • By Marcus Battle
    Reduce Spam Registrations in WordPress with Verification Emails using Twilio Verify Reduce Spam Registrations in WordPress

    It’s no secret to WordPress owners that the platform running their website and 35% of the Internet is a spam magnet. Its popularity has caused hackers to push the limits of their creativity, releasing spambots across a third of the Internet. This means that less-secure websites suffer from exploitations and data integrity issues.

    Whether you are hosting your favorite cooking blog or The New York Times, your WordPress website needs extra prevention to stop fraudulent activity. That’s why we’re creating an email verification system and incorporate it directly into the WordPress user registration flow to reduce fraud. At the end of this tutorial, you will have a custom WordPress plugin that sends a secure email to every registrant before they can access their account.

    Why Not Use WordPress’ Default Confirmations?

    If you’re unaware, WordPress does include email confirmation for new registrations, but this alone doesn’t prevent skilled hackers from …

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