From 8ce0d263c107113e9ee67a793c4d4154992b28ab Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 1 Dec 2014 21:59:46 -0600 Subject: [PATCH] Set fillable array. --- app/Services/Registrar.php | 2 +- app/User.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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. *