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 Lloyd MIller
    Build a Simple Chat Room App in React with Laravel Breeze and Twilio's Conversations API Build a Simple Chat Room App in React with Laravel Breeze and Twilio's Conversation API

    2020 was a huge year for Laravel. It was the year that we saw this beloved framework take leaps and bounds over its competition and push the PHP ecosystem further. The Laravel team managed to make the framework even more powerful by adding new authentication and scaffolding features, which include Jetstream and Breeze.

    Many developers know that full-stack apps with a Vue frontend can be quickly spun up with Laravel Jetstream. What many don’t know is that recently, the Laravel team made it easy to make an Inertia app with Laravel Breeze.

    With this knowledge, let’s have some fun and make a very simple Discord-like app called “Twilcord” that will let multiple users join a room via a phone number or  username. Instead of the default Vue frontend, we’ll be using React. This article will show you that you don’t need to build separate backends and frontends …

    Read More
  • By Oluyemi Olususi
    Get Started Testing a Yii2 API Using Codeception Get started testing a Yii2 API using Codeception

    Testing (and TDD by extension) has drummed up more than its fair share in terms of significant debates. While proponents and opponents may disagree on specifics, they always come to one conclusion: it is unprofessional to ship untested code. Testing provides a level of assurance, not only that the code meets the provided specification but that it can handle edge cases that may be encountered upon deployment.

    In this article, I will show you how to test a RESTful API built with the Yii framework (version 2)usingCodeception. Built on PHPUnit, Codeception provides support for creating and running unit, functional, and acceptance tests on PHP applications in a unified manner.

    To allow us to focus on the key aspects of testing in this tutorial, we’ll be building on the result of a previous tutorial where Yii2 was used to build a secure RESTful API. You're, however, very free …

    Read More
  • By Oluyemi Olususi
    Build a RESTful API using PHP and Yii2 Build a RESTful API using PHP and Yii2

    Since its introduction, RESTful architecture has redefined the way we think about (and build) software applications by breaking down complex application ecosystems into smaller, more focused applications communicating with each other via RESTful calls.

    Client-Server Architecture allows web clients and mobile apps to communicate with the same infrastructure (such as a server-side API) to provide a seamless user experience.

    In this tutorial, I will show you how to build a RESTful API using the Yii framework (version 2)- a high-performance, component-based PHP framework.


    A basic understanding of the Yii framework and PHP will be of help in this tutorial. However, I will provide brief explanations and links to the applicable parts of the official documentation throughout the tutorial. If you’re unclear on any concept, you can review the linked material before continuing.

    Additionally, you need to have the following installed on your system:

    • PHP version 7 or higher with …
    Read More
  • By Sylvan Ash
    Envoyer des rappels SMS en PHP depuis votre app Symfony rappels-sms-php-symphony-banner

    Si vous avez un système de réservations, et que vous prenez des rendez-vous de type massages, psychologues, dentaires ou médicaux, etc… ça serait sûrement pratique de rappeler aux clients la date de ce rendez-vous après qu’ils l’aient réservé, ou même à la personne qui leur offre le service.

    Dans ce tutoriel, vous apprendrez à envoyer des rappels SMS aux clients à un temps donné avant leur rendez-vous dans un projet Symfony qui utilise le service SMS de Twilio.

    Cet article part du principe que :

    • Vous avez déjà paramétré LAMP, MAMP, XAMPP, ou un environnement de développement équivalent.
    • Vous êtes familiers avec Symfony 

    Mise en place

    On utilisera composer (un outil pour la gestion des dépendances) afin d’installer Symfony et le  SDK Twilio. Les instructions d’installation de composer peuvent être trouvées ici. Aussi, soyez sûrs d’installer composer globalement en suivant les instructions dans la sous-partie globale …

    Read More
  • By Felistas Ngumi
    Envoyer un message WhatsApp en 30 secondes avec PHP php-whatsapp-twilio-banner

    WhatsApp est considéré comme l’une des apps de messagerie les plus utilisées. Au fil du temps, l’application s’est prouvée sécurisée et digne de confiance. On sait maintenant, grâce à des sondages récents, que les entreprises en ligne s’en servent comme moyen de communication pour contacter leurs clients, plutôt que de se servir du traditionnel SMS.

    Dans ce tutoriel, je vais vous apprendre comment intégrer la messagerie WhatsApp dans votre application en utilisant l’API Twilio pour les messages WhatsApp. Voici une vidéo de 30 secondes qui résume comment faire après l’installation.

    Dans cet article, vous aurez besoin de connaissances de bases en PHP et des commandes de base Unix/Linux. Si vous ne connaissez pas encore, ne soyez pas découragés, j’expliquerai tous les concepts en détail.


    Assurez-vous d’avoir à disposition ce qui suit :

    Pour commencer

    Ouvrez votre terminal et exécutez …

    Read More
  • By Joseph Udonsak
    Implement Two-Factor Authentication With Symfony and Twilio's Authy App and API Implement Two-Factor Authentication With Symfony and Twilio's Authy App and API

    The username and password are dead! Well, not really. But considering the times we live in, it’s dangerous to rely on them alone. Computers are getting faster and better at guessing our passwords. And there are numerous databases containing stolen passwords roaming the web. Consequently, you also need to use Two-factor Authentication (2FA) in order to keep your account safe.

    In this article, I will show you how to implement Two-factor authentication in a Symfony application using the Authy app to add an extra level of authentication to the traditional login form.


    Let's get started

    To get started, create a new Symfony project, named 2-fa-demo, and switch to the newly created project’s directory using the commands below.

    symfony new 2-fa-demo
    cd 2-fa-demo

    Next, you need to install …

    Read More
  • By Anumadu Udodiri Moses
    Create a Mailing List in PHP using Laravel, Vue.js, and Twilio's SendGrid Email API Create a Mailing List using Laravel, Vue.js and Twilio's SendGrid Email API

    The importance of email marketing cannot be over-emphasized in modern-day business, mostly because of its cost-effectiveness and conversion-to-sales ratio. This tutorial will teach you how to use Twilio’s SendGrid Email API with Laravel and a Vue.js frontend to send bulk emails to more than 100 email addresses at once. This removes the pain of sending out emails slowly, as well as the possibility of emails going to spam.

    After we’re finished, you will have developed a custom mailing list that:

    • Allows anyone to enter their email address and save it to the application database
    • Send out bulk emails to provided email addresses


    To follow along with this tutorial you should have the following in place:

    Read More
  • By Matthew Setter
    SMS mit Twilio versenden SMS mit Twilio versenden

    SMS ist eine einfache und etablierte Technologie mit der Unternehmen mit Ihren Kunden kommunizieren. Weltweit gibt es rund 7,2 Milliarden Mobiltelefone die SMS empfangen können, damit ist es sicherlich eine der verbreitetsten Technologien unserer Zeit.

    Im nachfolgenden Artikel wollen wir eine SMS aus einer einfachen Applikation über die Twilio API versenden. Die Integration ist einfach und mit jeder Programmiersprache möglich, in diesem Beispiel wollen wir die Twilio API mit PHP ansprechen.


    Für die nächsten Schritte benötigen wir die folgende vier Dinge:

    Abhängige Pakete Installieren und Composer Konfigurieren

    Bevor wir den eigentlichen PHP Code schreiben, müssen wir die abhängige Pakete installieren und Composer konfigurieren. Dafür benötigen wir nur zwei Pakete, zum einen das Twilio Client SDK, also die Schnittstelle zu Twilio. Das zweite Paket ist PHP dotenv, mit diesem Paket werden wir die nötigen Umgebungsvariablen konfigurieren.

    Zum Installieren der zwei Pakete …

    Read More
  • By Marcus Battle
    How to Send 1000 (or more) Text Messages in PHP Without Timing Out How to Send 1000 (or more) Text Messages in PHP Without Timing Out

    PHP developers of all experiences are painfully aware that your script may not execute if it takes longer than 30 seconds to process. There’s nothing worse than failing to do proper testing and finding that your code doesn’t scale in production.

    In a previous tutorial, I shared how you can calculate the script execution time of sending SMS messages. At the conclusion we discovered that each message takes about .33 seconds to send, meaning that PHP’s 30 second timeout will allow you to send 90 messages before failure.

    So what do you do when you want to send more than 90 messages? What about 1000?

    Unfortunately, if you want to send bulk SMS (or WhatsApp) messages using the standard Programmable Messaging API, it’s not going to scale in PHP. Great engineering practices would suggest that you break apart your requests and run batches asynchronously. However, Twilio engineering has …

    Read More
  • By Anumadu Udodiri Moses
    Authenticate Laravel Users Using JWTs and Twilio's WhatsApp Business API Authenticate Laravel Users Using JWTs and Twilio's WhatsApp Business API

    Web applications need a way of identifying users in order to serve dynamic data back to users. The process of collecting and storing data when a user registers, validating the data and recognizing a unique user when the user logs in is the authentication flow.

    As mankind continues to evolve, cybercrimes continue to increase by the day. The security of user’s data and their privacy becomes more important than ever. In the quest to achieve this, security measures such as the popular 2-step verification (2FA verification) are put in place.

    Implementing 2FA (Two-Factor Authentication) verification in modern web applications can be tricky. Nonetheless, do not worry as the Twilio API for WhatsApp has plenty of documentation and support to make this possible for developers.

    This tutorial is intended to teach you about the Twilio API for WhatsApp and custom token-based authentication in Laravel using JSON Web Tokens (JWTs). …

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