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 Matthew Setter
    How to Send an SMS with Mezzio PHP Framework How to Send an SMS with Mezzio PHP Framework

    Whether we’re voting for our favorite candidate on shows such as X Factor, or receiving two-factor authentication codes to log in to services like MailChimp and GitLab, SMS are virtually ubiquitous in modern life. Not only do they make communication in life and work much easier, it also doesn’t take a lot of code to send them either.

    In this tutorial, you’ll learn how to create a simplistic API that can send an SMS using PHP’s Mezzio framework and Twilio’s PHP SDK.

    Once completed, you will be able to send a POST request to the API’s default endpoint, supplying the phone number to send the message to, and the message to send. If the message was successfully sent, then a JSON response will be returned showing a number of details about the sent SMS. If the SMS was not able to be sent, then an appropriate JSON response will …

    Read More
  • By Michael Okoko
    Build an Urban Dictionary Chatbot in PHP with Bref and the Twilio API for WhatsApp Build an Urban Dictionary Chatbot in PHP with Bref

    Internet slang evolves so rapidly that it’s easy to get lost in communication while texting without the help of linguistic services like Urban Dictionary. Wouldn’t it be great if you could easily query new colloquialisms on the go?

    In this tutorial, we will build a handy WhatsApp bot that gives us the Urban Dictionary definition of words. It will leverage the Twilio API for WhatsApp and the Urban Dictionary API to find and provide the definitions we need, on demand.

    Prerequisites

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

    Get Started

    If you are using a UNIX or Mac OS system, create and enter into the project folder …

    Read More
  • By Ugendu Ositadinma
    Retrieving Phone Number Pricing for Twilio Programmable Voice using Laravel Retrieving Phone Number Pricing for Twilio Programmable Voice using Laravel

    The foremost issue when building solutions with third-party services is estimating the cost implications of consuming the API. This tutorial is a guide through the process of understanding the costs of Twilio’s phone number services using a Laravel application.

    Installation Requirements

    To begin with a Laravel project, all relevant modules required for proper functionality need to be installed. The modules are:

    Having installed Laravel on your machine, proceed to create a new project using the Laravel CLI:  

    $ laravel new project_name
    

    Or using the Composer create-project command:

    $ composer create-project --prefer-dist laravel/l …
    Read More
  • By Alex Dunne
    Build a Two-way Customer Support System with SMS and Slack using Symfony Notifier Build a Two-way Customer Support System with SMS and Slack using Symfony Notifier

    Businesses across the internet interact with millions of customers every day. Providing customers with a positive experience helps to build a strong brand image and increases their trust. Reliable, fast, and helpful customer support is a key component of great customer service and it all starts by providing a convenient and simple way to get in touch. Just as crucial is the need to provide your customer support team with the tools they need to assist your customers.

    In this tutorial, we’ll build an application that forwards incoming SMS in real-time and allows us to reply directly from a Slack channel using Twilio, Slack, and the Symfony framework.

    In doing so, you’ll see the Symfony Notifier Component in action and understand how to leverage it’s abstraction to communicate between the customer and your support staff through different communication channels. Finally, we’ll look at how to react to incoming …

    Read More
  • By Charles Oduk
    Automate a Confirmation Call in PHP with Programmable Voice and Autopilot Automate a Confirmation Call in PHP with Programmable Voice and Autopilot

    I recently had a dentist appointment. Two days before the appointment, I received a call from my dentist’s assistant, confirming if I was still available for the booking at the arranged time.

    While that was nice, I thought there would be an easier way to do it. It would be nice if this process could be automated and have assistants handle more complicated situations. In this tutorial we are going to work on a PHP application that automates this process using Twilio Programmable Voice and Autopilot.

    Tutorial Requirements

    This tutorial will require the following:

    Read More
  • By Michael Okoko
    Handling Cross-Origin Resource Sharing (CORS) Requests in Laravel 7 Handling Cross-Origin Resource Sharing (CORS) Requests in Laravel 7

    By default, browsers implement a same-origin policy that prevents scripts from making HTTP requests across different domains. Cross-Origin Resource Sharing (CORS for short) provides a mechanism through which browsers and server-side applications can agree on requests that are allowed or restricted.

    From version 7, the Laravel framework comes with first-party support for sending CORS headers using Middlewares

    In this tutorial, we'll be building a simple Vue.js app powered by Laravel to learn about CORS. We will take a deep-dive into the various configuration options needed by Laravel to handle CORS OPTIONS requests and see how some of these options affect our application.

    Prerequisites

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

    • Familiarity with the Laravel framework
    • An existing project with Laravel framework version >= 7.0.
    • Vue CLI installed.

    Getting Started  

    Create a new folder to hold both the Laravel API and the Vue project, and create …

    Read More
  • By Oluyemi Olususi
    Build a GraphQL Powered API with Laravel Build a GraphQL Powered API with Laravel

    Often referred to as a platform or programming language agnostic query language, GraphQL is a comprehensive approach to guide software engineers in building data-driven applications. It is, in my opinion, the new API standard, offering client applications the flexibility to request exact data and not an entire record from the database. If you are not yet conversant with this technology or looking for simplified technical content to guide you through, you are in the right place.

    In this tutorial, you will learn some of the fundamental concepts required to build a Laravel API powered by GraphQL. This is a shift from the conventional architecture of building REST APIs, as we will take a different approach in this tutorial. To help us explore GraphQL, we will build a bookstore API with an ability to carry out CRUD ( Create, Read, Update, Delete ) operations on data, in your database.

    Prerequisites …

    Read More
  • By Christina Hasternath
    Create a WordPress Plugin to Rebuild Your Gatsby App on AWS using GitHub Actions Create a WordPress Plugin to Rebuild Your Gatsby App on AWS using GitHub Actions

    For a while, our content editors at Postman had to log into GitHub and rebuild the Gatsby app every time they made a change or published a new blog post to the company’s WordPress. As you can imagine, this became very time consuming and wasn’t the most efficient use of our team’s time.

    To remedy this, I decided to sit down and write a PHP plugin for our WordPress Admin Dashboard, in order to enable our content writers to re-publish their changes from within our headless CMS.

    We used WPGraphQL to create a GraphQL layer from our WordPress content and query our data via the gatsby-source-graphql plugin to our Gatsby App. The resulting solution allowed our blog to be more secure, faster, and future proof.

    The plugin creates Nodes in Gatsby to turn the WordPress Data into pages. This results in the App updating its content at build time. If …

    Read More
  • By Ankit Jain
    Create a Real-Time Twitter Stream in PHP using Pusher and Laravel Create a Real-Time Twitter Stream App in PHP using Pusher and Laravel.png

    Introduction

    Laravel is one of the most famous PHP MVC frameworks, largely due to its commitment to modern architecture and active community. Laravel 7, the latest release, has added the coolest new features like Blade-X, Stubs, Cache optimization, and much more.

    Pusher is the hosted service that enables developers to add real time data and functionality easily and securely by taking care of all the heavy lifting under the hood.

    Laravel supports Pusher integration very gracefully, which makes it very easy for developers to add real-time functionality to their application. In this tutorial, we will be using Twitter APIs to fetch tweets based on a specific hashtag, and create a dashboard to display them in real-time using Pusher.

    How does Pusher work?

    Pusher uses Channels to provide real-time communication between the server and the client. What are these Channels? Pusher Channels are based on the popular Publish/Subscribe Model. …

    Read More
  • By Michael Okoko
    Process Incoming Emails with Laravel and SendGrid Inbound Parse Process Incoming Emails with Laravel and SendGrid Inbound Parse

    Sending emails from your Laravel app is a common requirement, but sometimes, you want to receive and process the replies programmatically as well. SendGrid lets you process inbound emails with Inbound Parse. Inbound Parse allows you to provide a webhook URL to process all incoming emails for a domain or subdomain. Subdomains are recommended as they don’t affect your regular domain emails.

    In this tutorial, we will be building a blog application where users can comment on a post by replying to a transaction email.

    Prerequisites

    To complete this tutorial, you will need:

    Create Migrations and Models

    To get started, create a new Laravel project in your preferred location (I am naming mine sg-inbound), switch to …

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