Answer the question
In order to leave comments, you need to log in
How to return all field values for him from the database when creating a user?
I'm trying to figure out the registration, there is such a method:
public function register(RegisterFormRequest $request)
{
$invite = $request->input('invite');
$invite = \App\Invite::where('invite',$invite)->first();
// Creating user
$user = new User;
$user->login = $request->login;
$user->email = $request->email;
$user->username = $request->name;
$user->password = bcrypt($request->password);
$user->invite_id = $invite->id;
$user->save();
// Закрепили инвайт за пользователем
$invite->user_id = $user->id;
$invite->save();
return response([
'status' => 'success',
'data' => $user
], 200);
}
$user->login = $request->login;
$user->email = $request->email;
$user->username = $request->name;
$user->password = bcrypt($request->password);
$user->invite_id = $invite->id;
$user
in a fragment:return response([
'status' => 'success',
'data' => $user
], 200);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question