<?php
|
|
|
|
namespace App;
|
|
|
|
use App\Events\UserCreating;
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
class Associate extends Authenticatable
|
|
{
|
|
use Notifiable;
|
|
|
|
/**
|
|
* The attributes that aren't mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $guarded = ['associate_category_id', 'associate_nature_id', 'associate_type_id', 'remember_token'];
|
|
|
|
/**
|
|
* The attributes that should be hidden for arrays.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $hidden = [
|
|
'password', 'remember_token',
|
|
];
|
|
|
|
/**
|
|
* The attributes that should be cast to native types.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'address' => 'array',
|
|
'birthday' => 'date',
|
|
'document' => 'array',
|
|
'profile' => 'array',
|
|
];
|
|
|
|
/**
|
|
* The event map for the model.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $dispatchesEvents = [
|
|
'creating' => UserCreating::class,
|
|
];
|
|
|
|
//
|
|
//
|
|
// =====================================================================
|
|
// RELATIONSHIPS
|
|
// =====================================================================
|
|
//
|
|
//
|
|
|
|
/**
|
|
* Get the associate's category.
|
|
*/
|
|
public function category()
|
|
{
|
|
return $this->belongsTo(AssociateCategory::class, 'associate_category_id');
|
|
}
|
|
|
|
/**
|
|
* Get the associate's nature.
|
|
*/
|
|
public function nature()
|
|
{
|
|
return $this->belongsTo(AssociateNature::class, 'associate_nature_id');
|
|
}
|
|
|
|
/**
|
|
* Get the associate's type.
|
|
*/
|
|
public function type()
|
|
{
|
|
return $this->belongsTo(AssociateType::class, 'associate_type_id');
|
|
}
|
|
|
|
//
|
|
//
|
|
// =====================================================================
|
|
// OTHER METHODS
|
|
// =====================================================================
|
|
//
|
|
//
|
|
}
|