{"id":16674443,"url":"https://github.com/settermjd/sms-phone-verification-php-original","last_synced_at":"2025-06-18T18:08:21.193Z","repository":{"id":257204858,"uuid":"856891356","full_name":"settermjd/sms-phone-verification-php-original","owner":"settermjd","description":"A small PHP project showing how to use Twilio Verify to verify phone numbers and add an additional layer of security to an application; helping to prevent fraudulent users from registering with your business.","archived":false,"fork":false,"pushed_at":"2024-09-23T06:53:23.000Z","size":2216,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T03:16:03.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/settermjd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-13T12:04:44.000Z","updated_at":"2024-09-23T06:53:27.000Z","dependencies_parsed_at":"2024-11-18T22:45:05.833Z","dependency_job_id":"e2a9f2c0-e3c3-452f-95cd-9064745448af","html_url":"https://github.com/settermjd/sms-phone-verification-php-original","commit_stats":null,"previous_names":["settermjd/sms-phone-verification-php","settermjd/sms-phone-verification-php-original"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/settermjd/sms-phone-verification-php-original","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Fsms-phone-verification-php-original","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Fsms-phone-verification-php-original/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Fsms-phone-verification-php-original/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Fsms-phone-verification-php-original/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/settermjd","download_url":"https://codeload.github.com/settermjd/sms-phone-verification-php-original/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Fsms-phone-verification-php-original/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260606509,"owners_count":23035353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T12:43:15.001Z","updated_at":"2025-06-18T18:08:16.175Z","avatar_url":"https://github.com/settermjd.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SMS Phone Verification with PHP\n\nThis is a small web application built around the Mezzio Skeleton is a basic SMS phone verification example with PHP and Twilio.\n\n## How Does It Work?\n\n* It uses [Twilio Verify][twilio_verify_url] to verify phone numbers, and to add an additional layer of security.\n  This helps prevent fraudulent users from registering with your business.\n* It renders a UI to create an account on a (fictional) website, where the customer would enter their username, password, and phone number.\n* Following a successful submission, it will send the customer an SMS with a verification code.\n* The customer will be asked to enter the code into a second form to verify the code.\n* If the code is successfully verified, then the user's fictitious account is considered created.\n\nThere is a bit more to it, but these are the essential points.\n\n## Prerequisites\n\nTo use this application, you're going to need:\n\n- A Twilio account (either free or paid) with a [Twilio phone number][twilio_phone_number_setup_url] that can handle phone calls.\n  If you are new to Twilio, [create a free account][twilio_referral_url].\n- PHP 8.3\n- [Composer][composer_url] installed globally\n\n## ⚡️ Quick Start\n\n### Set up the Application\n\nFirstly, clone this repository and change into the cloned directory with the following commands:\n\n```bash\ngit clone git@github.com:twilio-samples/sms-phone-verification-php.git\ncd sms-phone-verification-php\n```\n\nThen, install PHP's dependencies:\n\n```bash\ncomposer install\n```\n\n#### Configure the application\n\nAfter that, you need to set the environment variables which the application requires.\nThese are your **Twilio Account SID** and **Auth Token**.\nTo do that, first copy _.env.example_ (which has the variables defined but not set) as _.env_.\n\n```bash\ncp .env.example .env\n```\n\nThen, you need to retrieve your Twilio credentials from the **Account Info** panel in [the Twilio Console Dashboard][twilio_console_url].\nAfter you've retrieved them, set the values for `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN` in  _.env_ with the credentials that you just copied.\n\nFollowing that, create a Verify V2 service.\n\n![The Verify V2 services page in the Twilio Console](./docs/images/twilio-verify-services.png)\n\nFirst, open [the Twilio Console][twilio_console_url] in your browser of choice and navigate to **Explore products \u003e Verify \u003e** [Services][twilio_console_verify_services_url].\nThere, click **Create new**.\n\n![The initial form for creating a Verify V2 service in the Twilio Console](./docs/images/create-twilio-verify-service-step-one.png)\n\nIn the **_Create new_** [Verify Service] form that appears, provide a **Friendly name**, enable the **SMS** verification channel, and click **Continue**.\n\n![The Enable Fraud Guard stage of creating a new Verify V2 service in the Twilio Console](./docs/images/create-twilio-verify-service-step-two.png)\n\nFollowing that, click Continue in the Enable Fraud Guard stage.\n\n![The settings page of a Verify V2 service in the Twilio Console](./docs/images/twilio-verify-service-settings.png)\n\nNow, you'll be on the Service settings page for your new Verify Service.\nCopy the **Service SID** and set it as the value of `TWILIO_VERIFICATION_SID` in _.env_.\n\n### Start the Application\n\nNow, start the application using the following command:\n\n```bash\ncomposer serve\n```\n\n### Test the Application\n\n![The application's code request form](./docs/images/sms-phone-verification-step-one.png)\n\nTo test the application, open http://localhost:8080 in your browser of choice.\nThere, enter a username, password, and your phone number and click **Request Verification Code**.\n\n![The application's code verification form](./docs/images/sms-phone-verification-step-one.png)\n\nYou'll be redirected to the code verification form.\nSubmit the verification code that you received via SMS.\nIf verification was successful, you'll be redirected to the code verification form.\n\n## Contributing\n\nIf you want to contribute to the project, whether you have found issues with it or just want to improve it, here's how:\n\n- [Issues][issues_url]: ask questions and submit your feature requests, bug reports, etc\n- [Pull requests][pull_requests_url]: send your improvements\n\n## Resources\n\nFind out more about the project on [CodeExchange][code-exchange-url].\n\n## Did You Find The Project Useful?\n\nIf the project was useful and you want to say thank you and/or support its active development, here's how:\n\n- Add a GitHub Star to the project\n- Write an interesting article about the project wherever you blog\n\n## License\n\n[MIT](./LICENSE)\n\n## Disclaimer\n\nNo warranty expressed or implied. Software is as is.\n\n[code-exchange-url]: https://www.twilio.com/code-exchange/sms-phone-verification\n[composer_url]: https://getcomposer.org\n[issues_url]: https://github.com/settermjd/sms-phone-verification-php/issues\n[pull_requests_url]: https://github.com/settermjd/sms-phone-verification-php/pulls\n[mezzio-url]: https://docs.mezzio.dev/mezzio/\n[twilio]: https://www.twilio.com\n[twilio_console_url]: https://www.twilio.com/console\n[twilio_console_verify_services_url]: https://console.twilio.com/us1/develop/verify/services\n[twilio_verify_url]: https://www.twilio.com/en-us/user-authentication-identity/verify\n[mit_license_url]: http://www.opensource.org/licenses/mit-license.html\n[twilio_phone_number_setup_url]: https://www.twilio.com/docs/phone-numbers\n[twilio_referral_url]: https://www.twilio.com/try-twilio","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsettermjd%2Fsms-phone-verification-php-original","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsettermjd%2Fsms-phone-verification-php-original","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsettermjd%2Fsms-phone-verification-php-original/lists"}