dimanche 6 mars 2016

how to know the parent controller in nested routs Laravel?

in Larave 5.1 is there a way to know through what controller the method got called in a nested rout. for example if i have the following routs:

Rout::resource('post.comment','CommentController')
Rout::resource('user.comment','CommentController')

how to know if the index method in commentController called by post/{post}/comment or user/{user}/comment, do i need to use the URL or there is a better way to do that



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire