I have one web route
Route::post('users/{id}', [UserController::class, 'show'])->name('user.show');
Now, I need to get the id
key using the IlluminateSupportFacadesRoute
class.
Is there any function that exists in the router that returns what we pass in the route binding?
2
Answers
wherever in controller you can use the current request to do this:
and thanks to Maksim’s comment below:
in the blade view file you can use the request() like:
Route::input('id')
would be the way to do it using theRoute
facade.