34 lines
711 B
PHP
34 lines
711 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Modules\HRM\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||
|
|
|
||
|
|
class Designation extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'restaurant_id',
|
||
|
|
'department_id',
|
||
|
|
'title',
|
||
|
|
'description',
|
||
|
|
'status',
|
||
|
|
'meta',
|
||
|
|
];
|
||
|
|
|
||
|
|
public const TABLE_NAME = 'designations';
|
||
|
|
|
||
|
|
protected $table = self::TABLE_NAME;
|
||
|
|
|
||
|
|
public function department(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Department::class)->select('id', 'parent_id', 'name');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function users(): HasMany
|
||
|
|
{
|
||
|
|
return $this->hasMany(Employee::class);
|
||
|
|
}
|
||
|
|
}
|