I used the laravel built in authentication but i add another column which is role_id. In my Auth Register controller i specify a default value on role_id which is 3
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'role_id' => 3,
'password' => Hash::make($data['password']),
]);
}
but i got an error Field 'role_id' doesn't have a default value how can i fix this
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire