Add mnogo chego

This commit is contained in:
m.zargarov 2024-06-23 17:02:18 +04:00
parent 36cb0c700a
commit 6fb18f6949
21 changed files with 419 additions and 75 deletions

View File

@ -0,0 +1,43 @@
<?php
namespace App\Console\Commands;
use App\Models\Admin;
use App\Models\User;
use Illuminate\Console\Command;
class AddAdmin extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:add-admin';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Create new admin';
/**
* Execute the console command.
*/
public function handle()
{
$admin = Admin::create();
$user = User::create([
'email' => 'admin' . $admin->id . '@mail',
'password' => 'password',
]);
$admin->user()->save($user);
$this->info('Admin created successfully!');
$this->info('email = ' . $user->email);
$this->info('password = password');
}
}

View File

@ -5,11 +5,20 @@ namespace App\Enums;
enum ScoreEnum: string enum ScoreEnum: string
{ {
case WithoutScore = 'Без оценки'; case WithoutScore = 'Без оценки';
case One = '1';
case Two = '2'; case Two = '2';
case Three = '3'; case Three = '3';
case Four = '4'; case Four = '4';
case Five = '5'; case Five = '5';
case Absent = 'Н'; case Absent = 'Н';
case Sick = 'Б'; case Sick = 'Б';
public static function getNumScores(): array
{
return [self::Two, self::Three, self::Four, self::Five];
}
public static function getDebtScores(): array
{
return [self::Absent, self::Sick];
}
} }

View File

@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use App\Http\Requests\StudentPostRequest; use App\Http\Requests\StudentPostRequest;
use App\Models\Grade; use App\Models\Grade;
use App\Models\Student; use App\Models\Student;
use App\Models\Subject;
use App\Services\StudentService; use App\Services\StudentService;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\View\View; use Illuminate\View\View;
@ -119,10 +120,18 @@ class StudentController extends Controller
return redirect()->route('students.index'); return redirect()->route('students.index');
} }
public function scores(StudentService $service): View public function scores(StudentService $service, Subject $subject): View
{ {
return view('students.scores', [ return view('students.scores', [
'scores' => $service->getScores(), 'lessons' => $service->getScores($subject),
'avgScore' => $service->getAvgScore($subject),
]);
}
public function debts(StudentService $service): View
{
return view('students.debts', [
'lessons' => $service->getDebts(),
]); ]);
} }
} }

View File

@ -5,11 +5,19 @@ namespace App\Http\Controllers;
use App\Http\Requests\SubjectTeacherPostRequest; use App\Http\Requests\SubjectTeacherPostRequest;
use App\Models\Subject; use App\Models\Subject;
use App\Models\Teacher; use App\Models\Teacher;
use App\Services\TeacherService;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\View\View; use Illuminate\View\View;
class SubjectTeacherController extends Controller class SubjectTeacherController extends Controller
{ {
public function index(Teacher $teacher, TeacherService $service)
{
return view('subject-teacher.index', [
'subjects' => $service->getSubjects($teacher),
]);
}
public function create(Teacher $teacher): View public function create(Teacher $teacher): View
{ {
return view('subject-teacher.create', [ return view('subject-teacher.create', [

View File

@ -18,14 +18,14 @@ class TeacherController extends Controller
/** /**
* Display a listing of the resource. * Display a listing of the resource.
*/ */
public function index(): View public function index(TeacherService $service): View
{ {
if(request()->user()->cannot('viewAny', Teacher::class)) { if(request()->user()->cannot('viewAny', Teacher::class)) {
abort(403); abort(403);
} }
return view('teachers.index', [ return view('teachers.index', [
'teachers' => Teacher::filter()->paginate(5)->withQueryString(), 'teachers' => $service->getTeachers(),
]); ]);
} }

View File

@ -0,0 +1,26 @@
<?php
namespace App\Http\Middleware;
use App\Models\Student;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class StudentAction
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
if (Auth::user()->userable_type != Student::class) {
abort(403);
}
return $next($request);
}
}

View File

@ -14,7 +14,7 @@ class TeacherPolicy
*/ */
public function viewAny(User $user): bool public function viewAny(User $user): bool
{ {
return $user->userable_type != Student::class; return $user->userable_type != Teacher::class;
} }
/** /**
@ -22,7 +22,7 @@ class TeacherPolicy
*/ */
public function view(User $user, Teacher $teacher): bool public function view(User $user, Teacher $teacher): bool
{ {
return $user->userable_type == Teacher::class; return $user->userable_type == Admin::class;
} }
/** /**

View File

@ -22,6 +22,6 @@ class FileService
}); });
}); });
return Pdf::loadView('subjects.pdf', ['subjects' => $listSubjects])->download('subjects.pdf'); return Pdf::loadView('subjects.pdf', ['subjects' => $listSubjects])->download('Предметы.pdf');
} }
} }

View File

@ -4,6 +4,7 @@ namespace App\Services;
use App\Enums\ScoreEnum; use App\Enums\ScoreEnum;
use App\Models\Student; use App\Models\Student;
use App\Models\Subject;
use App\Models\User; use App\Models\User;
use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Collection;
use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Pagination\LengthAwarePaginator;
@ -56,13 +57,29 @@ class StudentService
$model->delete(); $model->delete();
} }
public function getScores(): Collection public function getScores(Subject $subject): Collection
{ {
$student = Auth::user()->userable; $student = Auth::user()->userable;
foreach ($student->lessons as $lesson) {
dd($lesson->pivot->score);
}
return $student->lessons; return $student->lessons()->where('subject_id', $subject->id)->get();
}
public function getAvgScore(Subject $subject)
{
$student = Auth::user()->userable;
$scores = $student
->lessons()
->where('subject_id', $subject->id)
->whereIn('score', ScoreEnum::getNumScores())
->pluck('score');
return round($scores->avg(), 2);
}
public function getDebts(): Collection
{
$student = Auth::user()->userable;
return $student->lessons()->whereIn('score', ScoreEnum::getDebtScores())->get();
} }
} }

View File

@ -11,9 +11,7 @@ class SubjectService
public function getSubjects() public function getSubjects()
{ {
if(Auth::user()->userable_type == Student::class) { if(Auth::user()->userable_type == Student::class) {
$student = Auth::user()->userable; return Subject::whereIn('id', Auth::user()->userable->grade->subjects->pluck('id'))
return Subject::whereIn('id', $student->grade->subjects->pluck('id'))
->filter() ->filter()
->paginate(5) ->paginate(5)
->withQueryString(); ->withQueryString();

View File

@ -2,9 +2,12 @@
namespace App\Services; namespace App\Services;
use App\Models\Student;
use App\Models\Subject;
use App\Models\Teacher; use App\Models\Teacher;
use App\Models\User; use App\Models\User;
use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Facades\Auth;
class TeacherService class TeacherService
{ {
@ -47,4 +50,30 @@ class TeacherService
$teacher->user()->delete(); $teacher->user()->delete();
$teacher->delete(); $teacher->delete();
} }
public function getTeachers()
{
if (Auth::user()->userable_type == Student::class) {
return Teacher::join('grade_teacher', 'teachers.id', '=', 'grade_teacher.teacher_id')
->where('grade_id', Auth::user()->userable->grade_id)
->filter()
->paginate(5)
->withQueryString();
}
return Teacher::filter()->paginate(5)->withQueryString();
}
public function getSubjects(Teacher $teacher)
{
if (Auth::user()->userable_type == Student::class) {
return Subject::join('subject_teacher', 'subject_teacher.subject_id', '=', 'subjects.id')
->join('grade_subject', 'grade_subject.subject_id', '=', 'subjects.id')
->where('grade_subject.grade_id', Auth::user()->userable->grade_id)
->where('subject_teacher.teacher_id', $teacher->id)
->get();
}
return $teacher->subjects;
}
} }

50
config/tinker.php Normal file
View File

@ -0,0 +1,50 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Console Commands
|--------------------------------------------------------------------------
|
| This option allows you to add additional Artisan commands that should
| be available within the Tinker environment. Once the command is in
| this array you may execute the command in Tinker using its name.
|
*/
'commands' => [
App\Console\Commands\AddAdmin::class,
],
/*
|--------------------------------------------------------------------------
| Auto Aliased Classes
|--------------------------------------------------------------------------
|
| Tinker will not automatically alias classes in your vendor namespaces
| but you may explicitly allow a subset of classes to get aliased by
| adding the names of each of those classes to the following list.
|
*/
'alias' => [
//
],
/*
|--------------------------------------------------------------------------
| Classes That Should Not Be Aliased
|--------------------------------------------------------------------------
|
| Typically, Tinker automatically aliases classes as you require them in
| Tinker. However, you may wish to never alias certain classes, which
| you may accomplish by listing the classes in the following array.
|
*/
'dont_alias' => [
'App\Nova',
],
];

View File

@ -18,9 +18,39 @@ class DatabaseSeeder extends Seeder
*/ */
public function run(): void public function run(): void
{ {
$namesSubjects = [
'Русский язык',
'Математика',
'Английский язык',
'Биология',
'Химия',
'Литература',
'География',
'История',
'Обществознание',
'Информатика',
];
$subjects = collect();
foreach ($namesSubjects as $name) {
$subjects->push(Subject::factory()->create([
'name' => $name,
]));
}
$letterGrades = ['A', 'Б', 'В',];
$numberGrades = 11;
$grades = collect();
while($numberGrades > 0) {
foreach ($letterGrades as $letter) {
$grades->push(Grade::factory()->create([
'name' => $numberGrades . $letter,
]));
}
$numberGrades--;
}
$teachers = Teacher::factory(15)->create(); $teachers = Teacher::factory(15)->create();
$grades = Grade::factory(10)->create();
$subjects = Subject::factory(10)->create();
$scores = ScoreEnum::cases(); $scores = ScoreEnum::cases();
$teachers->each(function ($teacher) { $teachers->each(function ($teacher) {
@ -28,33 +58,45 @@ class DatabaseSeeder extends Seeder
$teacher->user()->save($user); $teacher->user()->save($user);
}); });
$grades->each(function ($grade) use ($subjects, $teachers, $scores){ $teacher = Teacher::factory()->create();
$grade->subjects()->sync($subjects); $teacher->user()->save(User::factory()->create(['email' => 'teacher@mail']));
$grade->teachers()->sync($teachers); $teacher->grades()->attach($grades->pluck('id'));
$students = Student::factory(10)->create([ $student = Student::factory()->create(['grade_id' => $grades->first()->id]);
$student->user()->save(User::factory()->create(['email' => 'student@mail']));
$grade = $student->grade;
$lessons = collect();
$subjects->each(function ($item) use ($lessons, $teacher, $student, $grade) {
$teacher->subjects()->attach($item);
$grade->subjects()->attach($item);
$lessons->push(Lesson::factory(5)->create([
'description' => 'Выполнение задания №3 на 87 стр. учебника',
'grade_id' => $student->grade_id,
'subject_id' => $item->id,
'teacher_id' => $teacher->id,
]));
});
$grades->each(function ($grade) use ($subjects, $teachers, $scores){
Student::factory(30)->create([
'grade_id' => $grade->id, 'grade_id' => $grade->id,
])->each(function ($student) use ($scores) { ])->each(function ($student) use ($scores) {
$user = User::factory()->create(); $user = User::factory()->create();
$student->user()->save($user); $student->user()->save($user);
}); });
$lessons = Lesson::factory(30)->create([
'grade_id' => $grade->id,
'subject_id' => $grade->subjects->random()->id,
'teacher_id' => $grade->teachers->random()->id,
]);
$students->each(function ($student) use ($lessons, $scores) {
$lessons->each(function ($lesson) use ($student, $scores) {
$student->lessons()
->syncWithoutDetaching([$lesson->id => ['score' => $scores[array_rand($scores)]]]);
});
});
}); });
$subjects->each(function ($subject) use ($teachers) { $grade->students->each(function ($student) use ($grade, $scores) {
$subject->teachers()->sync($teachers->random(2)); $grade->lessons->each(function ($lesson) use ($student, $scores) {
$student->lessons()
->syncWithoutDetaching([
$lesson->id => ['score' => $scores[array_rand($scores)]]
]);
});
}); });
} }
} }

View File

@ -19,10 +19,12 @@
<h5><strong>Описание: </strong>{{ $lesson->description }}</h5> <h5><strong>Описание: </strong>{{ $lesson->description }}</h5>
</div> </div>
</div> </div>
<div class="card-footer"> @can('update', $lesson)
<a href="{{ route('lessons.scores.show', $lesson) }}" class="btn btn-success">Оценки</a> <div class="card-footer">
<a href="{{ route('grades.lessons.edit', [$grade, $lesson]) }}" class="btn btn-primary">Редактировать</a> <a href="{{ route('lessons.scores.show', $lesson) }}" class="btn btn-success">Оценки</a>
</div> <a href="{{ route('grades.lessons.edit', [$grade, $lesson]) }}" class="btn btn-primary">Редактировать</a>
</div>
@endcan
</div> </div>
</div> </div>
</div> </div>

View File

@ -11,29 +11,43 @@
</div> </div>
<!-- Navigation Links --> <!-- Navigation Links -->
@if(\Illuminate\Support\Facades\Auth::user()->userable_type != \App\Models\Student::class)
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex"> <div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
<x-nav-link :href="route('grades.index')" :active="request()->routeIs('dashboard')"> <x-nav-link :href="route('grades.index')" :active="request()->routeIs('grades.index')">
{{ __('Классы') }} {{ __('Классы') }}
</x-nav-link> </x-nav-link>
</div> </div>
@endif
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex"> <div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
<x-nav-link :href="route('subjects.index')" :active="request()->routeIs('dashboard')"> <x-nav-link :href="route('subjects.index')" :active="request()->routeIs('subjects.index')">
{{ __('Предметы') }} {{ __('Предметы') }}
</x-nav-link> </x-nav-link>
</div> </div>
@if(\Illuminate\Support\Facades\Auth::user()->userable_type != \App\Models\Student::class)
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex"> <div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
<x-nav-link :href="route('students.index')" :active="request()->routeIs('dashboard')"> <x-nav-link :href="route('students.index')" :active="request()->routeIs('students.index')">
{{ __('Студенты') }} {{ __('Студенты') }}
</x-nav-link> </x-nav-link>
</div> </div>
@endif
@if(\Illuminate\Support\Facades\Auth::user()->userable_type != \App\Models\Teacher::class)
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex"> <div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
<x-nav-link :href="route('teachers.index')" :active="request()->routeIs('dashboard')"> <x-nav-link :href="route('teachers.index')" :active="request()->routeIs('teachers.index')">
{{ __('Учителя') }} {{ __('Учителя') }}
</x-nav-link> </x-nav-link>
</div> </div>
@endif
@if(\Illuminate\Support\Facades\Auth::user()->userable_type == \App\Models\Student::class)
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
<x-nav-link :href="route('student-debts')" :active="request()->routeIs('student-debts')">
{{ __('Задолженности') }}
</x-nav-link>
</div>
@endif
</div> </div>
<!-- Settings Dropdown --> <!-- Settings Dropdown -->
@ -41,7 +55,7 @@
<x-dropdown align="right" width="48"> <x-dropdown align="right" width="48">
<x-slot name="trigger"> <x-slot name="trigger">
<button class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none transition ease-in-out duration-150"> <button class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none transition ease-in-out duration-150">
<div>{{ Auth::user()->name }}</div> <div>{{ Auth::user()->userable->fio }}</div>
<div class="ms-1"> <div class="ms-1">
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> <svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">

View File

@ -0,0 +1,28 @@
@extends('layouts.application')
@section('content')
<div class="container col-md-6">
<div class="row justify-content-center">
@if(count($lessons))
@foreach($lessons as $lesson)
<a href="{{ route('grades.lessons.show', [$lesson->grade_id, $lesson]) }}" class="text-decoration-none">
<div class="card mt-4">
<div class="card-header"><strong>{{ $lesson->subject->name }} - {{ $lesson->pivot->score }}</strong></div>
<div class="card-header">{{ $lesson->type }}</div>
<div class="card-body">
{{ $lesson->name }}
</div>
</div>
</a>
@endforeach
@else
<div class="card mt-4">
<div class="card-header"><strong>Задолженности</strong></div>
<div class="card-body">
Задолженности отсутствуют
</div>
</div>
@endif
</div>
</div>
@endsection

View File

@ -0,0 +1,24 @@
@extends('layouts.application')
@section('content')
<div class="container col-md-6">
<div class="row justify-content-center">
<div class="card mt-4">
<div class="card-header"><strong>Средняя оценка - {{ $avgScore }}</strong></div>
</div>
@if(count($lessons))
@foreach($lessons as $lesson)
<a href="{{ route('grades.lessons.show', [$lesson->grade_id, $lesson]) }}" class="text-decoration-none">
<div class="card mt-4">
<div class="card-header"><strong>{{ $lesson->subject->name }} - {{ $lesson->pivot->score }}</strong></div>
<div class="card-header">{{ $lesson->type }}</div>
<div class="card-body">
{{ $lesson->name }}
</div>
</div>
</a>
@endforeach
@endif
</div>
</div>
@endsection

View File

@ -0,0 +1,19 @@
@extends('layouts.application')
@section('content')
<div class="container col-md-6">
<div class="row justify-content-center">
<div class="card mt-4">
<div class="card-header">{{__('Предметы')}}</div>
<div class="card-body">
@if(count($subjects))
<ul class="list-group list-group-flush text-center">
@foreach ($subjects as $subject)
<li class="list-group-item">{{ $subject->name }}</li>
@endforeach
</ul>
@endif
</div>
</div>
</div>
@endsection

View File

@ -31,21 +31,30 @@
<tr> <tr>
<td class="table-text"> <td class="table-text">
<div> <div>
<a href="{{ route('subjects.show', $subject) }}" class="btn btn-block col-8">{{ $subject->name }}</a> {{ $subject->name }}
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<a href="{{ route('subjects.edit', $subject) }}" class="btn btn-warning">Редактировать</a> <a href="{{ route('student-scores', $subject) }}" class="btn btn-success">Оценки</a>
</div> </div>
</td> </td>
<td> @can('update', $subject)
<form action="{{ route('subjects.destroy', $subject) }}" method="POST" style="display: inline-block;"> <td>
@csrf <div>
@method('DELETE') <a href="{{ route('subjects.edit', $subject) }}" class="btn btn-warning">Редактировать</a>
<button type="submit" class="btn btn-danger">Удалить</button> </div>
</form> </td>
</td> @endcan
@can('delete', $subject)
<td>
<form action="{{ route('subjects.destroy', $subject) }}" method="POST" style="display: inline-block;">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">Удалить</button>
</form>
</td>
@endcan
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
@ -55,7 +64,9 @@
@endif @endif
</div> </div>
<div class="card-footer"> <div class="card-footer">
<a href="{{ route('subjects.create') }}" class="btn btn-success">Добавить</a> @can('create', \App\Models\Subject::class)
<a href="{{ route('subjects.create') }}" class="btn btn-success">Добавить</a>
@endcan
<a href="{{ route('export-pdf') }}" class="btn btn-info">PDF</a> <a href="{{ route('export-pdf') }}" class="btn btn-info">PDF</a>
</div> </div>
<div class="card-footer">{{ $subjects->links() }}</div> <div class="card-footer">{{ $subjects->links() }}</div>

View File

@ -31,21 +31,30 @@
<tr> <tr>
<td class="table-text"> <td class="table-text">
<div> <div>
<a href="{{ route('teachers.show', $teacher) }}" class="btn btn-block col-8">{{ $teacher->last_name }} {{ $teacher->name }} {{ $teacher->middle_name }}</a> {{ $teacher->fio }}
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<a href="{{ route('teachers.edit', $teacher) }}" class="btn btn-warning">Редактировать</a> <a href="{{ route('teachers.subjects.index', $teacher) }}" class="btn btn-warning">Предметы</a>
</div> </div>
</td> </td>
<td> @can('update', $teacher)
<form action="{{ route('teachers.destroy', $teacher) }}" method="POST" style="display: inline-block;"> <td>
@csrf <div>
@method('DELETE') <a href="{{ route('teachers.edit', $teacher) }}" class="btn btn-warning">Редактировать</a>
<button type="submit" class="btn btn-danger">Удалить</button> </div>
</form> </td>
</td> @endcan
@can('delete', $teacher)
<td>
<form action="{{ route('teachers.destroy', $teacher) }}" method="POST" style="display: inline-block;">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">Удалить</button>
</form>
</td>
@endcan
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
@ -54,9 +63,11 @@
<p>Учителя отсутствуют</p> <p>Учителя отсутствуют</p>
@endif @endif
</div> </div>
<div class="card-footer"> @can('create', Teacher::class)
<a href="{{ route('teachers.create') }}" class="btn btn-success">Добавить</a> <div class="card-footer">
</div> <a href="{{ route('teachers.create') }}" class="btn btn-success">Добавить</a>
</div>
@endcan
<div class="card-footer">{{ $teachers->links() }}</div> <div class="card-footer">{{ $teachers->links() }}</div>
</div> </div>
</div> </div>

View File

@ -2,6 +2,7 @@
use App\Http\Controllers\ProfileController; use App\Http\Controllers\ProfileController;
use App\Http\Middleware\AdminAction; use App\Http\Middleware\AdminAction;
use App\Http\Middleware\StudentAction;
use App\Http\Middleware\TeacherAction; use App\Http\Middleware\TeacherAction;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use App\Http\Controllers\GradeController; use App\Http\Controllers\GradeController;
@ -47,9 +48,12 @@ Route::middleware('auth')->group(function () {
Route::get('grades/{grade}/subjects/{subject}/journal', [GradeSubjectController::class, 'journal'])->name('grades.subjects.journal'); Route::get('grades/{grade}/subjects/{subject}/journal', [GradeSubjectController::class, 'journal'])->name('grades.subjects.journal');
}); });
Route::get('export-pdf', [SubjectController::class, 'exportToPDF'])->name('export-pdf'); Route::middleware([StudentAction::class])->group(function () {
Route::get('export-pdf', [SubjectController::class, 'exportToPDF'])->name('export-pdf');
Route::get('student-scores', [StudentController::class, 'scores'])->name('student-scores'); Route::get('subjects/{subject}/student-scores', [StudentController::class, 'scores'])->name('student-scores');
Route::get('student-debts', [StudentController::class, 'debts'])->name('student-debts');
Route::get('teachers/{teacher}/subjects', [SubjectTeacherController::class, 'index'])->name('teachers.subjects.index');
});
}); });
require __DIR__.'/auth.php'; require __DIR__.'/auth.php';