33 lines
710 B
PHP
33 lines
710 B
PHP
<?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();
|
|
}
|
|
} |