<?php

namespace App\Http\Livewire\Admin\Pages;

use App\Models\schclass;
use App\Models\Student;
use Livewire\Component;

class Resultmanagement extends Component
{
    public $stdClass;

    public function mount(){
        $this->students = null;
        $schClasses = schclass::where('status', 1)->get();
        $this->schClasses = $schClasses;
    }

    public function updatedStdClass(){
        $students = Student::with('ca')->where('schClass_id', $this->stdClass)->get();
        if($students->count() > 0){
            $this->students = $students;
        }else{
            $this->students = null;
        }
    }
    public function render()
    {
        return view('livewire.admin.pages.resultmanagement')->layout('layouts.adminApp');
    }
}
