birzha-legalizasia/app/Models/Company.php

85 lines
2.2 KiB
PHP
Raw Permalink Normal View History

<?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'];
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;
}
/*
|--------------------------------------------------------------------------
| RELATIONS
|--------------------------------------------------------------------------
*/
2022-07-08 09:40:16 +00:00
public function account()
{
return $this->morphOne(Account::class, 'profile');
}
/*
|--------------------------------------------------------------------------
| SCOPES
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| ACCESSORS
|--------------------------------------------------------------------------
*/
2022-11-29 08:56:58 +00:00
public function getFullNameAttribute(){
return $this->name;
}
/*
|--------------------------------------------------------------------------
| MUTATORS
|--------------------------------------------------------------------------
*/
}