Answer the question
In order to leave comments, you need to log in
How to do $data->wantsJson()?
// я не пойму как это тут отрабатывает, если поставить $myarray->wantsJson
// будет ошибка Call to a member function wantsJson() on array
} catch (ValidatorException $e) {
if ($data->wantsJson()) {
return response()->json([
'error' => true,
'message' => $e->getMessageBag()
]);
}
protected function create(array $data)
Answer the question
In order to leave comments, you need to log in
You are climbing the wrong place with wantsJson() and why do you need this exception? All these manipulations must be tracked in the register (Request there), the create () function only creates a user from the data array.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question