I don't think you can pass the middleware to Route::get method.
Please check: http://laravel.com/docs/5.1/routing#route-group-middleware http://laravel.com/api/5.1/Illuminate/Routing/Router.html#method_get
Route::group(['middleware' => 'auth'], function () {
Route::get('/', function () {
});
});
Although I like the Route::group method better, you can use pass a middleware to get methods. If you want the first way to work, you would need to do something like this:
Route::get('/dashboard', ['middleware' => 'auth', 'uses' => 'DashboardController@index']);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community