“Tutoriel Laravel Email Vérification Laravel 8” Réponses codées

Vérification par e-mail Laravel

Route::name('auth.resend_confirmation')->get('/register/confirm/resend', 'Auth\RegisterController@resendConfirmation');

Route::name('auth.confirm')->get('/register/confirm/{confirmation_code}', 'Auth\RegisterController@confirm');
Amused Ape

Tutoriel Laravel Email Vérification Laravel 8

<?php
  
namespace App\Http\Middleware;
  
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
  
class IsVerifyEmail
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        if (!Auth::user()->is_email_verified) {
            auth()->logout();
            return redirect()->route('login')
                    ->with('message', 'You need to confirm your account. We have sent you an activation code, please check your email.');
          }
   
        return $next($request);
    }
}
Muhammad Haseeb

Réponses similaires à “Tutoriel Laravel Email Vérification Laravel 8”

Questions similaires à “Tutoriel Laravel Email Vérification Laravel 8”

Plus de réponses similaires à “Tutoriel Laravel Email Vérification Laravel 8” dans PHP

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code