Started a new Laravel 5.2 project and implemented the default authentication that comes with it. I wanted to modify it so that the registration form has a field for first name and last name instead of just 'name'. I added the fields in the view, the verification, and the model. When I test I get the following:
Line 71 is in the following code block for last name or 'lname'.
protected function create(array $data)
{
return User::create([
'fname' => $data['fname'],
'lname' => $data['lname '],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
When I add a dd
on the data array right before the return/create
like this:
protected function create(array $data)
{
dd($data);
return User::create([
'fname' => $data['fname'],
'lname' => $data['lname '],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
We can clearly see that lname
is, in fact, present in that array and should not be an undefined index. What's going on?