Hi,
I have created posts like the tutorial on laracasts showed me. Then I created a review controller called postreviews where users can review the posts. Normally I call the postreviews on the individual post pages and display the content for that post.
What I wanted was to get the url www.site.com/post1/reviews so I created a route
Route::GET('/posts/{post}/reviews', 'PostReviewController@index');
This works great but I cant figure out how to only call the reviews for the specific post. Right now on my postreview index method I have
public function index()
{
$posts = Post::all();
$postreviews = PostReview::latest();
return view('ratings.index', compact('postreviews','posts'));
}
I tried using $this-> but I am not sure that the postreview controller knows which post I am telling it to look for.
Am I setting this up correctly?