<?php

namespace App\Http\Controllers\Teacher;

use App\Http\Controllers\Controller;

class ClassController extends Controller
{
    public function index()
    {
        $teacher = auth()->user();
        
        $myClasses = $teacher->taughtClasses()
            ->with(['subjects', 'school'])
            ->get();

        return view('teacher.classes.index', compact('myClasses'));
    }
}