CourseWork/routes/web.php

45 lines
1.8 KiB
PHP
Raw Normal View History

2024-04-15 16:23:05 +04:00
<?php
2024-06-16 00:41:31 +04:00
use App\Http\Controllers\ProfileController;
use Illuminate\Support\Facades\Route;
2024-04-16 13:27:51 +04:00
use App\Http\Controllers\GradeController;
2024-05-07 12:14:18 +04:00
use App\Http\Controllers\GradeSubjectController;
2024-05-07 15:05:10 +04:00
use App\Http\Controllers\GradeTeacherController;
2024-05-08 13:34:54 +04:00
use App\Http\Controllers\LessonController;
2024-05-17 18:46:12 +04:00
use App\Http\Controllers\ScoreController;
2024-04-23 14:52:49 +04:00
use App\Http\Controllers\StudentController;
2024-04-17 10:11:31 +04:00
use App\Http\Controllers\SubjectController;
2024-05-06 17:47:25 +04:00
use App\Http\Controllers\SubjectTeacherController;
2024-04-23 14:52:49 +04:00
use App\Http\Controllers\TeacherController;
2024-04-15 16:23:05 +04:00
Route::get('/', function () {
2024-06-16 00:41:31 +04:00
return redirect()->route('profile.edit');
});
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');
Route::middleware('auth')->group(function () {
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
Route::resources([
'grades' => GradeController::class,
'subjects' => SubjectController::class,
'students' => StudentController::class,
'teachers' => TeacherController::class,
'grades.lessons' => LessonController::class,
]);
Route::resource('teachers.subjects', SubjectTeacherController::class)->except('index');
Route::resource('teachers.subjects.grades', GradeTeacherController::class)->except('index', 'show');
Route::resource('grades.subjects', GradeSubjectController::class)->except('index', 'show');
Route::get('lessons/{lesson}/scores', [ScoreController::class, 'show'])->name('lessons.scores.show');
Route::put('lessons/{lesson}/scores', [ScoreController::class, 'update'])->name('lessons.scores.update');
2024-04-15 16:23:05 +04:00
});
2024-04-16 13:27:51 +04:00
2024-06-16 00:41:31 +04:00
require __DIR__.'/auth.php';