mikebarwick
4 years ago
114
18
General

Assigning middleware to route::resource

Posted 4 years ago by mikebarwick

I have a Route::resource that I can't seem to assign middleware too. What's the trick? I can do so on my controller construct, but no dice on my actual route. Help?

Tried these:

Route::resource('tasks', ['middleware' => 'auth', 'uses' => 'TaskController']);
Route::resource('tasks', 'TaskController', ['middleware' => 'auth']);

Please sign in or create an account to participate in this conversation.