40 lines
854 B
PHP
40 lines
854 B
PHP
<?php
|
|
|
|
namespace Modules\Admin\Models;
|
|
|
|
use App\Traits\StatusTrait;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Modules\Admin\Database\factories\CompanyFactory;
|
|
|
|
class Company extends Model
|
|
{
|
|
use HasFactory, StatusTrait;
|
|
|
|
protected $table = 'tbl_companies';
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected $fillable = [
|
|
'name',
|
|
'alias',
|
|
'company_type_id',
|
|
'address',
|
|
'bank_name',
|
|
'bank_acc_no',
|
|
'bank_acc_branch',
|
|
'status',
|
|
'description',
|
|
'remarks',
|
|
'createdBy',
|
|
'updatedBy',
|
|
];
|
|
|
|
protected $appends = ['status_name'];
|
|
|
|
protected function companyType()
|
|
{
|
|
return $this->belongsTo(CompanyType::class, 'company_type_id')->withDefault();
|
|
}
|
|
}
|