How to add a middleware in route group?



How to add a middleware in route group?..

Answer / sachin-laradev

Here is an example of auth middleware route group

Route: :group(['prefix' => 'auth'], function () {
Route::get('/login'"AuthController@login");
Route: :post('/login',"AuthController@authenticate');
Route: :get('/logout'"AuthController@logout");
});

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Laravel PHP Framework Interview Questions

How to configure route cache in laravel?

0 Answers  


Explain events in laravel?

0 Answers  


Explain response in laravel.

0 Answers  


Explain the concept of routing in laravel.

0 Answers  


What are laravel eloquent?

0 Answers  






How do you register service providers?

0 Answers  


How to register a service provider via composer in laravel?

0 Answers  


What do you mean by bundles?

0 Answers  


What is a controller middleware?

0 Answers  


How to enable query log in laravel 5?

0 Answers  


How do laravel facades work?

0 Answers  


What is guarded attribute in a model?

0 Answers  


Categories