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 an Order Tracking System in Laravel Powered by Twilio SMS Building an Order Tracking System in Laravel Powered by Twilio SMS

    In today's world where online shopping is at an all-time high, the chances of your e-commerce site standing out are going to be based on how much you can get your customers to trust in your service(s) and the level of satisfaction gotten from using them. One way of improving customer satisfaction and "trust" in your online shop is by allowing your customers to gain knowledge about the current state of their package.

    An order tracking system will allow your customers to gain more information about the current status/location of their package. Doing this will help increase the satisfaction of your customers, as they too will have detailed insight into where their package is at any given point in time until it arrives at their desired location.

    In this tutorial, you will learn how to use Twilio’s Programmable SMS to create an order tracking system using Laravel and update users …

    Read More
  • By Michael Okoko
    Set Up PHP CodeSniffer for Local Development Set up PHP CodeSniffer for Local Development

    PHP_CodeSniffer (PHPCS) is a tool that validates your code against a set of predefined standards and ensures that such standards are maintained across the team. This tutorial will walk you through automating those validations during development by setting up PHPCS on Sublime Text, Visual Studio Code, and PHPStorm.

    Note: The accompanying sample project is available at https://github.com/idoqo/twilio-greeter. You can also download the phpcs.xml to use in your existing project.

    Prerequisites

    Completing this tutorial requires the following prerequisites:

    Installing PHP Code Sniffer

    All of the editors below require PHPCS to be pre-installed, and since we plan to use it across projects, we will install it globally with the following command:

    $ composer global require "squizlabs/php_codesniffer=*"
    

    You can check your installation with:

    $ phpcs
    

    Note: If you get an error similar to command not found, …

    Read More
  • By Gary Hockin
    PHP 7.4 - 6 Compelling New Features Graded PHP 7.4 - 6 Compelling Features Graded

    PHP 7.4 has arrived, and it's shipped the usual raft of exciting features and improvements. For a recent live stream, we looked at all the features in the release notes and figured out what each one means in a coding sense. Let's take a look at some of the new features in PHP 7.4, and grade each one from A-F depending on how interesting they are, and my excitement to use them.

    Note: This is my personal opinion based on my own unique experiences and opinions. You'll probably disagree with some of my grades, and that's good. Your opinions and experiences are different from mine. Let me know in the comments or on Twitter where you feel I went wrong.

    Typed Properties

    We've been waiting for this feature since PHP 7.0 introduced scalar type declarations and return types, and I, for one, am very excited. We can now set …

    Read More
  • By Chimezie Enyinnaya
    Add Chat to a Laravel PHP App Using Twilio Chat Add Chat to a Laravel App Using Twilio Chat

    In this tutorial, I’ll be showing you how to add chat functionality to a Laravel application 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 one-to-one chat functionality. Users will be able to select another user to begin chat.

    Getting Twilio Credentials

    Login to your Twilio dashboard and copy both your ACCOUNT SID and AUTH TOKEN.

    Twilio Account Credentials

    Before you can start using the Twilio Programmable Chat API, you need to first create a chat service:

    Twilio Programmable Chat Dashboard

    Take note of your SERVICE SID.

    Base Configuration

    Lastly, you need to create an API key:

    New API Key screen

    Also, take note of both your API SECRET and API SID. …

    Read More
  • By Brian Iyoha
    How to Build a Web-Based Email Client in Laravel PHP using Twilio SendGrid Laravel Email Client

    Building an app and sharing it with the world can be an intimidating process. In the early stage of your development and marketing, the need to keep in touch with your users becomes critical to your growth.

    One of the best ways to keep in touch with your users is via email. Emails can be used to keep your users in the loop of the latest features, "bug" fixes, and also a great way to follow up on inactive users.

    In this tutorial, we will look at how we can build a custom web-based email client to add to an existing Laravel Application. After completing this tutorial, you will have built a custom mailing system using Laravel and Twilio SendGrid.

    Prerequisites

    In order to follow this tutorial you will need:

    • Basic knowledge of Laravel
    • Laravel installed on your local machine
    • Composer globally installed
    • MySQL set up on your local …
    Read More
  • 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
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.