Answer the question
In order to leave comments, you need to log in
How can I implement a bunch of two models?
public function showPost(Post $post) { return $post };
public function showPostWithContent(Post $post, Content $content) { return $content };
Answer the question
In order to leave comments, you need to log in
But if we pick up the following route... /posts/{post = slug}/{content = content_slug} we don't actually check if the given content belongs to the current post. What a hole - if we take the content slug from another post, which id = 2 (Post: id = 2), and write /posts/{post: id = 1}/content_slug (inheriting from post: id =1), we we'll get it. It should not be.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question