In a laravel app I had run the command
php artisan make:auth
and a laravel register form created successfully.
In mysql users' table I had added a proffession field of varchar datatype column and 190 length.
And I updated Auth/register.blade.php page to the following
register.blade.php
<div class="form-group">
<label for="proffession" class="col-md-4 control-label"> proffession </label>
<div class="col-md-6">
<input id="proffession" type="text" class="form-control" name="porffession"
value="{{ old('proffession') }}" required>
</div>
</div>
My RegisterController.php class
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|string|max:255',
'phone' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed',
]);
}
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'phone' => $data['phone'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
}
but when I click the submit button the proffession column value is always null although a new user added.
name="porffession"typo.. surely should bename="proffession"no?