How to add a middleware in route group?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is orm in laravel?

497


What is difference between implicit and explicit route binding in laravel?

475


Where can I learn laravel?

458


What is bootstrap software development?

475


How to use aggregate functions in laravel query?

479






What is the directory structure of laravel 5.6?

459


Is laravel based on symfony?

467


What getfacadeaccessor method does?

502


How to create custom library in laravel?

473


Explain dependency injection and their types.

514


What is php artisan serve in laravel?

459


What are the difference between soft delete & delete in laravel?

449


How do I register an artisan command?

466


What is Named Routes.

641


What is database migration. How to create migration via artisan?

449