54 lines
1.1 KiB
PHP
54 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Onboarding extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'name',
|
|
'email',
|
|
'type',
|
|
'status',
|
|
'join_date',
|
|
'exit_date',
|
|
'department',
|
|
'assigned_roles',
|
|
'assigned_apps',
|
|
'checklist',
|
|
'notes',
|
|
'created_by',
|
|
'offboarded_by',
|
|
'offboarded_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'join_date' => 'date',
|
|
'exit_date' => 'date',
|
|
'offboarded_at' => 'datetime',
|
|
'assigned_roles' => 'array',
|
|
'assigned_apps' => 'array',
|
|
'checklist' => 'array',
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
|
|
public function creator()
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
|
|
public function offboarder()
|
|
{
|
|
return $this->belongsTo(User::class, 'offboarded_by');
|
|
}
|
|
}
|