PHP code example of xutl / laravel-passport-sms

1. Go to this page and download the library: Download xutl/laravel-passport-sms library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xutl / laravel-passport-sms example snippets


// config/app.php
'providers' => [
    ...
    "XuTL\Passport\Sms\SmsLoginGrantProvider::class,
    ...
];

$response = $http->post('http://your-app.com/oauth/token', [
    'form_params' => [
        'grant_type' => 'sms',
        'client_id' => 'client-id',
        'client_secret' => 'client-secret',
        'phone' => '13800138000', 
        'verifyCode' => 'SMS verifyCode',
    ],
]);

## Example

Here is what a `User::byPassportSmsRequest()` method might look like...