<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class StaffUser extends Model
{
    protected $table = 'staff_users';

    protected $fillable = [
        'user_id', 'name', 'role', 'avatar', 'is_active', 'permissions',
    ];

    protected function casts(): array
    {
        return [
            'is_active'   => 'boolean',
            'permissions' => 'array',
        ];
    }

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}
