PHP code example of sadiqsalau / laravel-otp-password

1. Go to this page and download the library: Download sadiqsalau/laravel-otp-password 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/ */

    

sadiqsalau / laravel-otp-password example snippets


use Illuminate\Http\Request;
use SadiqSalau\LaravelOtpPassword\Facades\OtpPassword;

Route::post('/forgot-password', function (Request $request) {
    $request->validate(['email' => '              : back()->withErrors(['email' => __($status)]);
})->middleware('guest')->name('password.email');

    'passwords' => [
        'users' => [
            'provider' => 'users',
            'expire' => 15
        ],
    ],

use App\Models\User;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use Illuminate\Validation\Rules;
use SadiqSalau\LaravelOtpPassword\Facades\OtpPassword;

Route::post('/reset-password', function (Request $request) {
    $request->validate([
        'email' => ['equest->password),
                'remember_token' => Str::random(60),
            ])->save();

            event(new PasswordReset($user));
        }
    );

    return $status === OtpPassword::PASSWORD_RESET
                ? redirect()->route('login')->with('status', __($status))
                : back()->withErrors(['email' => [__($status)]]);
})->middleware('guest')->name('password.update');