How to verify phone numbers with PHP, Symfony, and Twilio

Codevate
1 min readNov 20, 2017

--

This article describes a way to integrate Twilio within a Symfony project to enable phone number verification. We demonstrate how to model and validate a user’s phone number, and use Twilio’s PHP SDK to create a call flow where the user is required to enter a 6 digit code that they receive via SMS in order to verify their phone number.

Our frontend view will feature a form that captures the user’s number, giving further instructions or presenting validation errors. Once verified, the user is seamlessly redirected to another page.

This post assumes that you are looking to add Twilio to an existing Symfony project. If you don’t have an existing project you can still follow this tutorial and create a Symfony 3 project with basic user handling. For those who don’t use Symfony, you should be able to carry the core ideas across to your preferred framework.

Read the rest of this article on Codevate’s software development blog:

--

--

Codevate

We’re a UK software development studio that digitally transforms small/medium businesses with best-in-class bespoke apps. Read our blog at https://cdv8.me/blog