StocksNew/Modules/Admin/app/Models/Company.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

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();
}
}