Support the ongoing development of Laravel.io →
posted 5 years ago
Last updated 2 years ago.
0

you have to put your /hello above your /{restaurant}. Laravel is trying to resolve the {variable} instead of the /hello so its looking for a Restaurant model of /hello from that {} above

Route::get('/', 'RestaurantsController@index')->name('Restaurants.list');
Route::post('/', 'RestaurantsController@store');
Route::get('/create', 'RestaurantsController@create');
Route::get('/hello', 'RestaurantsController@hello'); //<--put this here so it is resolved before the following line
Route::get('/{restaurant}', 'RestaurantsController@showprofile')->name('restaurant.showprofile');
Route::put('/{restaurant}', 'RestaurantsController@update');
Route::delete('/{restaurant}', 'RestaurantsController@destroy');
Route::get('/{restaurant}/edit', 'RestaurantsController@edit');

Last updated 5 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Zaid alphacoder001 Joined 25 Nov 2018

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.