How to Laravel route with Get to a specific method in a class

Routing to a specific controller method in Laravel is fun but only if you know the syntax. Here it is:

Route::get('/user', [UserController::class, 'index']);



Share this article

Share on facebook
Share on twitter
Share on linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top