StocksNew/Modules/Admin/app/Models/Department.php

33 lines
710 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?php
namespace Modules\Admin\Models;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Modules\Employee\Models\Employee;
class Department extends Model
{
use HasFactory, StatusTrait;
protected $table = 'tbl_departments';
protected $primaryKey = 'department_id';
protected $fillable = [
'name',
'department_head',
'status',
'description',
'remarks',
'createdBy',
'updatedBy'
];
protected $appends = ['status_name'];
public function departmentHead()
{
return $this->belongsTo(Employee::class, 'employee_id')->withDefault();
}
}