Source: chrysanthos.xyz

? SMS OTP Verification for Laravel
In some occasions you may need to add OTP verification for your logged-in dashboard. Various ways exist for OTP verification (like Laravel https://jetstream.laravel.com//https://laravel.com/docs/9.x/fortify) which will require your end user to have a separate mobile app for this.

The package provides an easy way to add SMS OTP verification to your app.

The Laravel OTP package by default listens to the Login event to send a notification to the user.

generateOtpAndSend($request->user()); return response()->noContent(); } public function check(Request $request) { $request->validate([ 'otp' => ['required', 'numeric'], ]); $otpValid = app(OtpService::class)->check($request->user(), $request->get('otp')); throw_unless($otpValid, ValidationException::withMessages([ 'otp' => 'Invalid otp!', ])); return back(); } public function resend(Request $request) { app(OtpService::class)->generateOtpAndSend($request->user()); return back(); }}
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners