There are two ways to delete a post in my app:
way 1:
/
-> posts/{post}
-> posts/{post}
which is just:
home
-> show
-> destroy
way 2:
posts
-> show
-> destroy
which is my posts
-> show
-> destroy
how can redirect the user back to where he came from after deleting?
I want him to be redirected to home in way 1 and to my posts in way 2.
I’ve seen that it could be done using a hidden input field like this:
<input type="hidden" name="redirect" value="home">
but this won’t really work because both ways are using the same blade view show
, so should I just create a separate view for each one of them or is there a better way to do so?