<?php

namespace App\Models;

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

class AdminRevisionWizard extends Model
{
    use HasFactory;

    protected $table = 'admin_revision_wizards';

    protected $fillable = [
        'class_id',
        'subject_id',
        'title',
        'file',
        'issue_date'
    ];
    
    protected $casts = [
        'class_id' => 'integer',
        'subject_id' => 'integer',
    ];

    public function classRelation()
    {
        return $this->belongsTo(Classes::class, 'class_id')->withTrashed();
    }
    
    public function subject()
    {
        return $this->belongsTo(Subject::class, 'subject_id')->withTrashed();
    }
}
