Reputation: 24122
How can I pass in my own extra named routes for a resource controller?
I have:
Route::resource('logistics', 'LogisticsController', ['names' => [
'index-inbound' => 'logistics.indexInbound'
]]);
But this does not work.
Upvotes: 0
Views: 136
Reputation: 153030
You can't really add additional routes to a resource route. However, you can add any other routes you want and point them to the same controller:
Route::get('logistics/inbound', ['name' => 'logistics.index-inbound', 'uses' => 'LogistictsController@indexInbound']);
Route::resource('logistics', 'LogisticsController');
Just make sure that you register your custom routes before the resource route as otherwise they might get overridden.
Upvotes: 1