<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Swindon\FilamentHashids\Traits\HasHashid;

class Contact extends Model
{
    use HasHashid;

    protected $guarded = ['id'];

    protected function casts(): array
    {
        return [
            'replied_at' => 'datetime',
            'replied_by' => 'integer',
        ];
    }

    public function repliedBy(): BelongsTo
    {
        return $this->belongsTo(User::class, 'replied_by');
    }
}
