I am using the Laravel 5.2 Auth function and registration is working fine.
Now I need to write a row in a special column in the user table during registration. This is not the value from the input of an HTML form. This is static text describing the role of the user (contributor). All registered users should receive the value "contributor" in the user_role column. I tried to achieve this by adding this line to AuthController.php:
'user_role' => 'contributor',
The whole function of adding values to the database is as follows:
protected function create(array $data)
{
return User::create([
'first_name' => $data['first_name'],
'last_name' => $data['last_name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'user_role' => 'contributor',
]);
}
, , 'user_role' => 'contributor',.
"" user_role?
, $data?