<?php

namespace App\Http\Controllers\StudentPortal\Concerns;

use App\Models\Student;

trait ResolvesStudent
{
    protected function student(): Student
    {
        $student = auth()->user()->student;

        abort_if(! $student, 403, 'No student record is linked to this account.');

        return $student;
    }
}
