Route::resource('posts','PostsController');
Route::post('posts/changeStatus', array('as' => 'changeStatus', 'uses' => 'PostsController@changeStatus'));
The code provided is a route from my laravel project. I did not write this code and I am attempting to understand what they have done. I cannot find anywhere in the documentation the reason for using the key value store with 'as' and 'uses'. I would normally write the code below, however this is not working with the ajax-crud setup.
Route::post('posts/changeStatus', 'PostsController@changeStatus');
Route::post('posts/changeStatus', 'PostsController@changeStatus')->name('changeStatus')instead.