PHPackages                             alhaji-aki/laravel-phone-number-verification - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. alhaji-aki/laravel-phone-number-verification

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

alhaji-aki/laravel-phone-number-verification
============================================

A package to help verify phone numbers using otp tokens

1.2.0(1y ago)78.6k1[3 PRs](https://github.com/alhaji-aki/laravel-phone-number-verification/pulls)MITPHPPHP ^8.1|^8.2|^8.3|^8.4CI passing

Since Dec 12Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/alhaji-aki/laravel-phone-number-verification)[ Packagist](https://packagist.org/packages/alhaji-aki/laravel-phone-number-verification)[ RSS](/packages/alhaji-aki-laravel-phone-number-verification/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (9)Versions (17)Used By (0)

Laravel Phone Number Verification
=================================

[](#laravel-phone-number-verification)

This is a simple package to help verify users phone number. This package uses [alhaji-aki/laravel-otp-token](https://github.com/alhaji-aki/laravel-otp-token) to generate and send otp tokens to users

Installation
------------

[](#installation)

You can install the package via composer by running:

```
composer require "alhaji-aki/laravel-phone-number-verification"
```

After the installation has completed, the package will automatically register itself. Run the following to publish the migration, config and lang file

```
php artisan phone-number-verification:install
```

This publishes a `PhoneNumberVerificationController` in `App\Http\Controllers\Auth`.

***NOTE:*** This package does not work on views so you will have to do some minor changes if you want to display views instead json responses.

Since this package uses [alhaji-aki/laravel-otp-token](https://github.com/alhaji-aki/laravel-otp-token), you will have to publish its files

```
php artisan vendor:publish --provider="AlhajiAki\OtpToken\OtpTokenServiceProvider"
```

After publishing the files, you can run migrations:

```
php artisan migrate
```

Let your model implement the `CanSendOtpToken` contract and use the `CanSendOtpToken` trait like so:

```
