<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

class schclass extends Model
{
    use HasFactory;
    protected $fillable =  [
        'class',
        'status',
        'subject_no',
    ];
    public function student(){
        return $this->hasMany(Student::class);
    }
    public function subject(){
        return $this->hasMany(Subject::class);
    }
    public function ca(){
        return $this->hasManyThrough(Result::class, StudentCA::class, 'id', 'id', 'subject_id', 'result_id');
    }
}
