Check if there's a free Laracast on this subject, I believe there is.
But basically you are getting the data from a form and inserting it into the database.
Something like:
public function postRegister(RegisterRequest $request)
{
$user = new \App\User();
$user->userid = $request->input('userid');
$user->password = \Illuminate\Support\Facades\Hash::make($request->input('password'));
$user->save();
$this->auth->login($user);
return redirect('where ever');
}
Of course you may want to validate the data.
If you are new to L5, STOP / HALT, view as many free laracast as you can first, and you'll have a better understanding of things.
Thanks Jim for your answer. I added Stats::create([]); in my app/services/Registrar.php.
public function create(array $data)
{
Stats::create([]); // Added this code
return User::create([
'username' => $data['username'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
This seems very ugly but I only have defaults value in this table so I thought why not
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community