2022-06-28 11:28:57 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class Company extends Model
|
|
|
|
|
{
|
|
|
|
|
use CrudTrait;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| GLOBAL VARIABLES
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
protected $table = 'companies';
|
|
|
|
|
// protected $primaryKey = 'id';
|
|
|
|
|
// public $timestamps = false;
|
2022-08-09 10:12:46 +00:00
|
|
|
// protected $guarded = ['id'];
|
2022-06-28 11:28:57 +00:00
|
|
|
protected $fillable = [
|
|
|
|
|
'name',
|
|
|
|
|
'short_name',
|
|
|
|
|
'registration_number',
|
|
|
|
|
'registration_date',
|
|
|
|
|
'state_registration_agency',
|
|
|
|
|
'registration_place',
|
|
|
|
|
'registration_address',
|
|
|
|
|
'fond_capital',
|
|
|
|
|
'management_types',
|
|
|
|
|
'signers',
|
|
|
|
|
'share_holders',
|
|
|
|
|
'organizational_form',
|
|
|
|
|
'is_agent'
|
|
|
|
|
];
|
|
|
|
|
// protected $hidden = [];
|
|
|
|
|
// protected $dates = [];
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'management_types' => 'array',
|
|
|
|
|
'signers' => 'array',
|
|
|
|
|
'share_holders' => 'array',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| FUNCTIONS
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
2022-08-08 12:26:57 +00:00
|
|
|
public function getFillable(){
|
|
|
|
|
return $this->fillable;
|
|
|
|
|
}
|
2022-06-28 11:28:57 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| RELATIONS
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
2022-07-08 09:40:16 +00:00
|
|
|
public function account()
|
2022-06-28 11:28:57 +00:00
|
|
|
{
|
2022-07-14 07:19:53 +00:00
|
|
|
return $this->morphOne(Account::class, 'profile');
|
2022-06-28 11:28:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| SCOPES
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| ACCESSORS
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
2022-11-29 08:56:58 +00:00
|
|
|
public function getFullNameAttribute(){
|
|
|
|
|
return $this->name;
|
|
|
|
|
}
|
2022-06-28 11:28:57 +00:00
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| MUTATORS
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
}
|