lundi 19 août 2019

Laravel throwing 404 for an existing route

Can someone help me understand what is wrong with these routes:-

From the list of these routes, the third and the last one returns 404. There is no issue with the controllers. They show up as expected when I run php artisan route:list.

Route::get('/uploads', 'ImageController@adminIndex')->name('admin.images.index');
Route::get('/uploads/{image}', 'ImageController@adminShow')->name('admin.image.indivisual');
Route::get('/uploads/request', 'ImageController@imageRequests')->name('admin.images.request');
Route::get('/uploads/request/{image}', 'ImageController@individualRequest')->name('admin.images.request.individual');
Route::post('/uploads/accept', 'ImageController@acceptImage')->name('admin.accept.image');
Route::post('/uploads/decline/', 'ImageController@declineImage')->name('admin.decline.image');
Route::get('/uploads/all', 'ImageController@index')->name('admin.images.list');

The thing that confuses me is that changing uploads to images for these two routes solved the problem and they work just fine.

Route::get('/uploads', 'ImageController@adminIndex')->name('admin.images.index');
Route::get('/uploads/{image}', 'ImageController@adminShow')->name('admin.image.indivisual');
Route::get('/images/request', 'ImageController@imageRequests')->name('admin.images.request');
Route::get('/uploads/request/{image}', 'ImageController@individualRequest')->name('admin.images.request.individual');
Route::post('/uploads/accept', 'ImageController@acceptImage')->name('admin.accept.image');
Route::post('/uploads/decline/', 'ImageController@declineImage')->name('admin.decline.image');
Route::get('/images/all', 'ImageController@index')->name('admin.images.list');

I have tried php artisan route:clear.

Also, there are no folders in the public directory to create any conflicts.

Note: All the routes are grouped in

Route::group(['prefix' => 'admin', 'middleware' => 'role:administrator|auth'], function () {
  // Other routes in this group are working just fine. No issues.
});

Appreciate the help.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Z2xrcP
via IFTTT

Aucun commentaire:

Enregistrer un commentaire