From bab00ae0d9716b0c07c096f487c1aa4d302f37ce Mon Sep 17 00:00:00 2001 From: Guilherme Capanema Date: Tue, 2 Jun 2020 15:36:58 -0300 Subject: [PATCH] =?UTF-8?q?Corrige=20associa=C3=A7=C3=A3o=20de=20indiv?= =?UTF-8?q?=C3=ADduos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Livewire/Auth/Register/Individual.php | 10 +++++----- app/User.php | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/Http/Livewire/Auth/Register/Individual.php b/app/Http/Livewire/Auth/Register/Individual.php index c7ffb78..34ca135 100644 --- a/app/Http/Livewire/Auth/Register/Individual.php +++ b/app/Http/Livewire/Auth/Register/Individual.php @@ -130,14 +130,14 @@ class Individual extends Component ]); $user = new User([ - 'name' => $this->name, - 'birthday' => Carbon::createFromFormat('d/m/Y', $this->birthday), 'address' => $this->address, - 'profile' => $this->profile, - 'document' => $this->document, - 'discussion' => $this->discussion, + 'birthday' => Carbon::createFromFormat('d/m/Y', $this->birthday), 'contribution' => $this->contribution, + 'discussion' => $this->discussion, + 'document' => $this->document, 'email' => $this->email, + 'name' => $this->name, + 'profile' => $this->profile, ]); $user->user_category_id = UserCategory::where('key', 'individual')->first()->id; diff --git a/app/User.php b/app/User.php index c40c78b..2c70129 100644 --- a/app/User.php +++ b/app/User.php @@ -11,13 +11,11 @@ class User extends Authenticatable use Notifiable; /** - * The attributes that are mass assignable. + * The attributes that aren't mass assignable. * * @var array */ - protected $fillable = [ - 'name', 'email', 'password', 'birthday', 'document' - ]; + protected $guarded = ['user_category_id', 'user_nature_id', 'user_type_id', 'remember_token']; /** * The attributes that should be hidden for arrays. @@ -34,6 +32,7 @@ class User extends Authenticatable * @var array */ protected $casts = [ + 'address' => 'array', 'birthday' => 'date', 'document' => 'array', 'profile' => 'array',