Answer the question
In order to leave comments, you need to log in
How to create an extra empty entry in another laravel table?
In general, everything works for me, everything creates, but when auto authorization pops up an error like:
Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, instance of Illuminate\Http\RedirectResponse given
File RegisterController.php
protected function create
$model = User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
$user = new Book();
$user->user_id = $model->id;
$user->save();
return Redirect::to('/home');
Answer the question
In order to leave comments, you need to log in
$model = User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
$user = new Book();
$user->user_id = $model->id;
$user->save();
return $model;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question