dimanche 7 avril 2019

Laravel Route goes to Controller but does not display data

I created the following route

Route::resource('posts','PostController');

Now I'm trying to create a custom route

Route::get('posts/trashed','PostController@trashed')->name('posts.trashed');

When the link posts/trashed is clicked, it goes to the PostController@trashed, but the controller shows blank page without any errors.

So changed the custom route to

`Route::get('post/trashed','PostController@trashed')->name('posts.trashed');

by simply changing the posts/trashed to post/trashed and the controller works fine.

Can someone explain what the issue is.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire