If I have route like this.
Route::get('/users/{user}/posts/{post}', function (User $user, Post $post) {
return $post;
});
Then If User
id 1 has Post
id 1,2,3 and User
id 2 has Post
id 4,5,6.
How to make Post
that bind in route return 404
. When Post
was not create by User
like /users/1/posts/4
.
2
Answers
So the point is I used
scopeBindings
chain fromRoute::resource
. So it didn't workIt have to use this way
It work perfectly.
Documentation