Laravel 5 : get route parameter in Controller 's constructor
public function __construct(Request $request)
{
$id = $request->route('id');
dump($id);
}
You should be able to do something like this
$id = Route::current()->getParameter('id');
Update:
Starting in laravel 5.4 getParameter
was renamed to parameter
$id = Route::current()->parameter('id');
You can call anywhere:
request()->route('id');
No need for injection