35 lines
738 B
PHP
35 lines
738 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Modules\HRM\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
use Modules\Authentication\Models\User;
|
||
|
|
|
||
|
|
class EmployeeShiftAssignment extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'restaurant_id',
|
||
|
|
'employee_id',
|
||
|
|
'shift_id',
|
||
|
|
'status',
|
||
|
|
'created_at',
|
||
|
|
'updated_at',
|
||
|
|
'deleted_at',
|
||
|
|
];
|
||
|
|
|
||
|
|
public const TABLE_NAME = 'employee_shift_assignments';
|
||
|
|
|
||
|
|
protected $table = self::TABLE_NAME;
|
||
|
|
|
||
|
|
public function employee(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'employee_id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function shift(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Shift::class, 'shift_id');
|
||
|
|
}
|
||
|
|
}
|