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

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