Reputation: 3746
I have the following route in a Laravel application:
Route::get('/post/view/{id}', 'PostController@getView');
However I am unsure how to use the id passed as a parameter in the Controller method PostController@getView.
Is there a simple way to pass the route parameter into the desired controller method?
Upvotes: 3
Views: 4034
Reputation: 5656
Have you tried this code? This method should be in your controller.
public function getView($id)
{
dd($id);
}
Let me know if that helped.
Thanks
Upvotes: 3