<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Titip extends Model
{
    use HasFactory;

    protected $table = 'titips';

    protected $fillable = [
        'qurban_participant_id',
        'dititipkan_ke',
        'status',
        'taken_at',
    ];

    protected $casts = [
        'taken_at' => 'datetime',
    ];

    public function participant()
    {
        return $this->belongsTo(QurbanParticipant::class, 'qurban_participant_id');
    }

    public function entrustee()
    {
        return $this->belongsTo(QurbanParticipant::class, 'dititipkan_ke');
    }
}
