<?php

namespace App\Models;

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

class Guide extends Model
{
    use HasFactory;

    protected $fillable = [
        'type',
        'title',
        'description',
        'pdf_file',
    ];

    // Guide types
    const TYPE_PRAYER_GUIDE = 'prayer_guide';
    const TYPE_MORE_ZIKAR = 'more_zikar';
    const TYPE_HAJJ_UMRAH = 'hajj_umrah';

    public static function getTypes()
    {
        return [
            self::TYPE_PRAYER_GUIDE => 'Prayer Guide',
            self::TYPE_MORE_ZIKAR => 'More Zikar',
            self::TYPE_HAJJ_UMRAH => 'Hajj & Umrah',
        ];
    }

    public function getTypeNameAttribute()
    {
        return self::getTypes()[$this->type] ?? $this->type;
    }
}
