Try to add this route underneath.
Route::get('/{id}', 'PostsController@show');
Your route is calling a controller, but not the function in the controller as @nepras mentions. Your route should be:
Route::get('/{id}/','PostsController@show');
or
Route::get('/{id}',['as' => 'id','uses' => 'PostsController@show']);
Thank you for your replies.
rberlin01 said:
Your route is calling a controller, but not the function in the controller as @nepras mentions.
This is RESTful Controller, by defining this route:
Route::resource('/', 'PostsController');
I can use these methods: index, create, store, show, edit, update, destroy
This solution is worked for me, but after doing so, I needed to define other route like so either:
Route::resource('/', 'PostsController');
Route::get('/{id}', 'PostsController@show');
Route::get('/{id}/edit', 'PostsController@edit');
Route::put('/{id}', 'PostsController@update');
Route::delete('/{id}', 'PostsController@destroy');
d252874 liked this reply
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community