Answer the question
In order to leave comments, you need to log in
Request not coming, why?
Made a post route. For tests, I removed it from csrf protection. I send data to it via postman (via the date form and tried it via raw-> json), in the controller
public function test(Request $request)
{
dd($request->all());
}
[]
Answer the question
In order to leave comments, you need to log in
Good afternoon!
You are getting json data, not form inputs. Therefore, you receive through or through .
You can also do this:
When sending JSON requests to your application, you may access the JSON data via the input method as long as the Content-Type header of the request is properly set to application/json. You may even use "dot" syntax to dig into JSON arrays:json_decode($request->getContent(), true)
$request->json()->all()
$name = $request->input('user.name');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question