*/ protected $fillable = [ 'leave_id', 'old_status', 'new_status', 'changed_by', 'changed_at', 'comment', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'changed_at' => 'datetime', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function leave(): BelongsTo { return $this->belongsTo(Leave::class); } public function user(): BelongsTo { return $this->belongsTo(User::class, 'changed_by'); } }