Browse Source

Corrige associação de indivíduos

usuarios_separados
Guilherme Capanema 6 years ago
parent
commit
bab00ae0d9
2 changed files with 8 additions and 9 deletions
  1. +5
    -5
      app/Http/Livewire/Auth/Register/Individual.php
  2. +3
    -4
      app/User.php

+ 5
- 5
app/Http/Livewire/Auth/Register/Individual.php View File

@ -130,14 +130,14 @@ class Individual extends Component
]); ]);
$user = new User([ $user = new User([
'name' => $this->name,
'birthday' => Carbon::createFromFormat('d/m/Y', $this->birthday),
'address' => $this->address, 'address' => $this->address,
'profile' => $this->profile,
'document' => $this->document,
'discussion' => $this->discussion,
'birthday' => Carbon::createFromFormat('d/m/Y', $this->birthday),
'contribution' => $this->contribution, 'contribution' => $this->contribution,
'discussion' => $this->discussion,
'document' => $this->document,
'email' => $this->email, 'email' => $this->email,
'name' => $this->name,
'profile' => $this->profile,
]); ]);
$user->user_category_id = UserCategory::where('key', 'individual')->first()->id; $user->user_category_id = UserCategory::where('key', 'individual')->first()->id;


+ 3
- 4
app/User.php View File

@ -11,13 +11,11 @@ class User extends Authenticatable
use Notifiable; use Notifiable;
/** /**
* The attributes that are mass assignable.
* The attributes that aren't mass assignable.
* *
* @var array * @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. * The attributes that should be hidden for arrays.
@ -34,6 +32,7 @@ class User extends Authenticatable
* @var array * @var array
*/ */
protected $casts = [ protected $casts = [
'address' => 'array',
'birthday' => 'date', 'birthday' => 'date',
'document' => 'array', 'document' => 'array',
'profile' => 'array', 'profile' => 'array',