<?php

namespace App\Http\Controllers\Teacher\Concerns;

use App\Services\School\TeacherScopeService;

trait ResolvesTeacherScope
{
    protected function scope(): TeacherScopeService
    {
        return app(TeacherScopeService::class);
    }

    protected function ensureClassAccess(int $classId): void
    {
        abort_unless($this->scope()->canAccessClass($classId), 403);
    }
}
