When a user registers, how do I save some default user settings in a user_settings table I have table? I have the hasOne and belongsTo relation setup for the 2 models. I tried something like this in the register controller, but got an error.
protected function create(array $data)
{
$user = User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
Return Usersetting::create([
'user_id' => $user->id,
'user_name' => 'u'.$user->id,
'profile_name' => $user->name,
'user_email' => $user->email,
'user_private account' => 0,
'user_fans_counter' => 1,
'new_subscriber_alert' => 1,
'new_tip_alert' => 1,
'new_private_message_alert' => 1,
'new_referral_alert' => 1,
]);
}