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

Abrar_ul_Hassan's avatar

No Understood what line say?Middleware

'Route::middleware(['auth:sanctum','verified'])->get('/dashboard', function () { return view('dashboard'); })->name('dashboard');' what this line say confuse, auth::sanctum.,verified

0 likes
4 replies
Snapey's avatar

the visitor must be authenticated and have verified their email address

1 like
tykus's avatar

@Abrar_ul_Hassan the framework allows for convenient aliases (names) for Middleware classes. What you are seeing is the defined Route applies two middlewares to protect access

  1. an auth middleware using the sanctum guard to ensure the user is authenticated
  2. a verified middleware that ensures that the authenticated user has verified their email address - a common practice for newly registered users before they are allowed to access to certain protected areas (defined by you/business)

Reading the relevant docs linked above should address any questions, but come back if necessary...

puklipo's avatar

Laravel often uses aliases to make things shorter.

Please or to participate in this conversation.