Answer the question
In order to leave comments, you need to log in
How to pass a parameter from $_POST to the controller?
There is a controller that accepts a parameter in this way:
I want to make it accept a parameter via post, it turned out like this:Route::get('/path/{token}', '[email protected]');
Route::post('/path', function () {
return (new Controller)->verify($_POST['token']);
});
Answer the question
In order to leave comments, you need to log in
What???? Would you like to rewrite?
Route::post('path', '[email protected]');
// вот это
public fuction verify($token){}
// нежелательно переписать в это?
public fuction verify(Request $request)
{
$token = $request->token;
}
Have you tried reading the documentation?
For example, https://laravel.com/docs/5.6/middleware but it's still a crutch, because the only right solution is to rewrite the controller.
You, if anything, just hint - I'll call the police, because you seem to be threatened and forbidden to change the controller. I don't see any other reason.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question