Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MCLTano's avatar

Two or more VerificationController for email

Hi, anyone know how send email verify depends on the user, i have three type of user, student, teacher, and user->like visitor, of course i've add two guards and providers to auth.php. Now when i try to register i watch if i change the VerificationController:

$this->middleware('auth');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');

like:

$this->middleware('auth:student');   //It's fine, works good. but if i write one by one
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');

but when i write, something like this:

$this->middleware('auth','auth:student', 'auth:teacher');  //failed
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
$this->middleware('auth'); //falied
$this->middleware('auth:student'); //failed
$this->middleware('auth:teacher'); //failed
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');

or

$this->middleware(['auth', 'auth:student','auth:teacher']); //failed

but, it doesn't work. Help.

Regards.

0 likes
2 replies
jlrdw's avatar

A user is a user.

You use authentication to login, you use authorization to determine who can and cannot do what.

You should really View the free from scratch video series he covers both authentication and authorization and demonstrates proper usage.

This question has come up many times, with the same answer each time a user is a user.

Please or to participate in this conversation.