PHP code example of alive2212 / laravel-mobile-passport
1. Go to this page and download the library: Download alive2212/laravel-mobile-passport 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/ */
alive2212 / laravel-mobile-passport example snippets
$app->register(Alive2212\LaravelMobilePassport\LaravelMobilePassportServiceProvider::class);
$app->router->group([
'namespace' => 'Alive2212\LaravelMobilePassport\Http\Controllers',
], function ($router) {
public function boot()
{
$this->registerPolicies();
Passport::routes();
LaravelMobilePassport::initPassportTokenCan();
LaravelMobilePassportSingleton::$otpCallBack = function (
Request $request,
User $user,
AliveMobilePassportDevice $device,
$token
) {
// dispatch send sms job here to send notification
};
LaravelMobilePassportSingleton::$otpConfirmCallBack = function (
Request $request,
User $user,
PersonalAccessTokenResult $token,
ResponseModel $response
) {
// put something here like update user name with request fields
};
}