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 Brian Iyoha
    Building a Food Ordering App in PHP with Laravel and Twilio SMS Building a Food Ordering App in PHP with Laravel and Twilio SMS

    In this tutorial, I will teach you how to use Twilio’s Programmable SMS to create an SMS based food ordering service using Laravel. After we’re finished, your users will be able to place orders for food items via SMS.

    Prerequisites

    In order to follow this tutorial, you will need:

    Getting Started

    Start off by creating a new Laravel project. This can be done using either the Laravel installer or Composer. We will be making use of the Laravel installer in this tutorial. If you don’t have it installed, you can check out how to do so from the Laravel documentation.

    To generate a fresh Laravel project, run the following command on your terminal:

    $ laravel new twilio-food-ordering
    

    Next, proceed to install the Twilio SDK for PHP. Change your working directory to …

    Read More
  • By Brian Iyoha
    Securing a Laravel PHP Application with 2FA using Twilio Authy Securing a Laravel PHP Application with 2FA using Twilio Authy

    In this tutorial, you will learn how to secure your Laravel application with Two-factor authentication using Twilio Authy.

    Prerequisites

    Completing this tutorial will require the following:

    Getting Started

    Create a new Laravel project using the Laravel Installer. If you don’t have it installed or prefer to use Composer, you can check out how to do so from the Laravel documentation. Run the following command in your terminal to generate a fresh Laravel project:

    $ laravel new twilio-authy
    

    Next, you will need to set up a database for the application. For this tutorial, we will make use of MySQL database. If you make use of a database administrator like phpMyAdmin for managing your databases then go ahead and create a database named twilio-authy and skip this section. If not, install MySQL from …

    Read More
  • By Gary Hockin
    Adding Twig as a View Renderer to Slim in PHP Adding Twig as a View Renderer to Slim in PHP

    Slim is an excellent PHP micro-framework. Out of the box it gives you compatibility with PHP standards (PSRs), PSR-11 for the container, PSR-7 for HTTP messages and PSR-15 for middleware. Its lightweight design gives you the bare minimum to get started with your web application; routing, a middleware dispatcher, error handling and a container. You need to wire up the additional services needed to handle requests and return responses.

    But where do we start? Let's take a look at installing a clean installation of Slim from a community skeleton, and add our first component to it; the Twig templating engine.

    Starting with Slim

    Slim provides a skeleton application that lets you get started quickly, but it's designed more with an API in mind than a web application. I prefer to start with a more lightweight skeleton from Slim maintainer Rob Allen. Rob’s starter comes with PHP-DI dependency …

    Read More
  • By Felistas Ngumi
    Send Email Attachments Using Twilio SendGrid and PHP PHP Email Attachments with SendGrid

    Companies with a clear commitment to efficient communication rely heavily on email as a communication tool. At some point, this dependency requires sending email attachments to customers for transactions such as receiving their invoice after an online purchase, sending of travel itinerary and many more. These attachments can be images, videos, or even documents. Twilio SendGrind API provides a simple and efficient way of doing this. In this tutorial, I will take you through how to send email attachments with SendGrid and PHP.

    Prerequisites

    Ensure you have the following installed in your local development environment:

    1. PHP version 7.0 or higher
    2. Composer

    Also, head over to SendGrid and create a free account.

    Getting Started

    In your preferred terminal, run the following commands to set up the project:

    $ mkdir demo && cd demo
    $ touch email.php
    $ composer require sendgrid/sendgrid vlucas/phpdotenv
    

    The above commands created a folder called demo which …

    Read More
  • By Chimezie Enyinnaya
    How to Create a Laravel Notification Channel for WhatsApp with Twilio Laravel Notifications

    Laravel makes it easy to send notifications in your PHP application. Out of the box it supports various channels such as mail, SMS, Slack, and database. What if we want to send notifications to a different channel aside these ones, say WhatsApp? In this tutorial, I’ll be showing you how to implement WhatsApp notifications in your Laravel app using the Twilio API for WhatsApp.

    Tools Needed to Complete This Tutorial

    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 using the concept of an ordering system. For the sake of brevity, we won’t build a fully-featured ordering system, just the part where the system sends out notifications.

    Creating a New Laravel Application

    Let’s get started by creating …

    Read More
  • By Paul Kamp
    Install the Twilio PHP Helper Library Without Composer php-helper-library-no-composer-header

    PHP is a venerable language. As I go to press, it’s in major version 7 and has maintained it’s well-deserved popularity for nearly 25 years.

    With two and a half decades of evolution, we PHP developers have quite a few ways to do things. To wit: many of you ask us how to use Twilio’s PHP Helper Library directly, without a package manager.

    Today, I’ll show you how to install Twilio’s PHP Helper Library on *NIX or Mac OSX without using the package manager Composer.

    Let’s compose some magic.

    Prerequisites to Install The Twilio PHP Helper Library (Without Composer)

    Before we get started with the install, you’ll need to set a few things up, confirm a few others, and find a phone:

    Read More
  • By Brian Iyoha
    How to Verify Phone Numbers in a Laravel PHP Application with Twilio Verify Laravel Verify

    In this tutorial, we will look at how to verify phone numbers using Twilio Verify by building a simple authentication system in Laravel.

    Twilio Verify makes it easier and safer than custom verification systems to verify a user’s phone number. It ensures that the phone number is valid by sending a short code via SMS to the number during registration. This can help reduce the number of fake accounts created and failure rates when sending SMS notifications to users.

    Prerequisite

    In order to follow this tutorial, you will need:

    Getting started

    Create a new Laravel project using the Laravel Installer. If you don’t have it installed or prefer to use Composer, you can check how to do so from the Laravel documentation. Run this command in your console window to generate a …

    Read More
  • By Charles Oduk
    Create Transactional Emails you can Reply to in PHP with Twilio SendGrid Inbound Parse Replyable Transactional Emails in PHP with Twilio SendGrid Inbound Parse.png

    You’ve probably received many emails sent in the format noreply@somedomain.com. The irony of no-reply emails are that they often contain information that we would like to respond to. It would be great for businesses sending transactional emails to empower customers to respond to these emails.

    Allowing replies to transactional emails is now possible with Twilio SendGrid. This tutorial will teach you how to use Twilio SendGrid Inbound Parse to place a second order to a mock e-commerce store, by replying to a transactional email.

    Tutorial Requirements

    This tutorial will require the following dependencies:

    Create a Development Environment

    From your console window, create a new project directory. Add three files to the newly created directory:

    • Webhook.php
    • Email.php
    • .env
    $ mkdir SendGrid && cd SendGrid
    $ touch Webhook.php Email.php .env
    

    Install Dependencies

    This project will require …

    Read More
  • By Marcus Battle
    How to Send Bulk Emails in PHP using Twilio SendGrid How to send bulk emails in PHP using Twilio SendGrid

    Frequent and relevant communication with attendees is necessary when planning an event. There are too many opportunities for confusion if timely and detailed messages are not sent. Even when everything goes according to plan guests still need reminders as the event date draws closer.

    Bulk emails are a great method to keep everyone in the loop.

    In this tutorial, we will learn how to send bulk emails to an email list in PHP using Twilio SendGrid.

    We’ll use a foreach() loop to parse through an array of email addresses and build a single array of recipients using SendGrid’s personalization class. SendGrid allows us to personalize each email that every recipient receives. We can even modify content based on the individual email address.

    Tools Needed to Complete This Tutorial

    To complete this tutorial you’ll need the following dependencies installed:

    Get Started with …

    Read More
  • By Marcus Battle
    Send Transactional Emails in PHP with Twilio SendGrid Transactional Emails in PHP with Twilio SendGrid

    Your inbox is undoubtedly full of transactional emails. While they prevent you from getting to inbox zero, without them, you’d have a less informative Internet experience.

    Transactional emails are those sent from within an application when a certain event is triggered. In the case of an e-commerce store, you would send a transactional email when the user has completed their account signup and when they successfully complete their purchase.

    Historically, sending an email in PHP has been one of the simplest tasks to complete. With only the mail() function, you need only to insert a call to the mail() function within any part of your workflow to send a transactional email.

    It’s simplicity, though, has also been its downfall. If you are unfamiliar with the mail() function, know that PHP developers have a love-hate relationship with it because, while it’s easy to implement, it has its challenges with bulk …

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