Monday, February 27, 2017

[SOLVED]'as' parameter in the route::controller - Laravel 5.2

Within my application i was working with the following route:
Route::get('router', ['as' => 'router.index', 'uses' => 'RouterController@index']);

For the purposes of using Datatables, the route has to be defined differently.
Route::controller('router', 'RouterController', [
    'dataTablesData' => 'datatables.data',
    'index' => 'router',
    ]);

This causes my application to crash due to the missing 'as' => 'router.index'. Where should I place the as parameter in a Route::controller?




via Anna Jeanine

Advertisement