diff --git a/app/Services/Registrar.php b/app/Services/Registrar.php index 9f62ed55..10354681 100644 --- a/app/Services/Registrar.php +++ b/app/Services/Registrar.php @@ -29,7 +29,7 @@ public function validator(array $data) */ public function create(array $data) { - return User::forceCreate([ + return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), diff --git a/app/User.php b/app/User.php index 5bf6d522..2dae8479 100644 --- a/app/User.php +++ b/app/User.php @@ -17,6 +17,13 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon */ protected $table = 'users'; + /** + * The attributes that are mass assignable. + * + * @var array + */ + protected $fillable = ['name', 'email', 'password']; + /** * The attributes excluded from the model's JSON form. *