<?php

namespace App\Models;

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

class Surah extends Model
{
    use HasFactory;

    protected $fillable = [
        'surah_no',
        'surah_name',
        'surah_name_arabic',
        'surah_name_arabic_long',
        'surah_name_translation',
        'revelation_place',
        'total_ayah',
        'audio',
    ];

    protected $casts = [
        'audio' => 'array',
    ];

    // Relationship to Ayats
    public function ayats()
    {
        return $this->hasMany(Ayat::class);
    }

    // Relationship to Sajdahs
    public function sajdahs()
    {
        return $this->hasMany(Sajdah::class);
    }
}
