⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.36
Server IP:
15.204.235.159
Server:
Linux srv.techlup.co.ke 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Wed Jun 5 09:12:13 EDT 2024 x86_64
Server Software:
Apache
PHP Version:
8.3.16
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
tech
/
web.techlup.co.ke
/
FinancialLMS
/
routes
/
View File Name :
web.php
<?php use App\Http\Controllers\ProfileController; use App\Http\Controllers\Admin\AdminDashboardController; use App\Http\Controllers\Admin\CourseController; use App\Http\Controllers\Admin\ModuleController; use App\Http\Controllers\Admin\LessonController; use App\Http\Controllers\Student\StudentDashboardController; use App\Http\Controllers\Student\CourseController as StudentCourseController; use App\Http\Controllers\Student\LessonController as StudentLessonController; use Illuminate\Foundation\Application; use Illuminate\Support\Facades\Route; use Inertia\Inertia; Route::get('/', function () { return Inertia::render('Welcome', [ 'canLogin' => Route::has('login'), 'canRegister' => Route::has('register'), 'laravelVersion' => Application::VERSION, 'phpVersion' => PHP_VERSION, ]); }); Route::get('/dashboard', function () { if (auth()->user()->hasRole('admin')) { return redirect()->route('admin.dashboard'); } return redirect()->route('student.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'); }); // Admin Routes Route::middleware(['auth', 'role:admin'])->prefix('admin')->name('admin.')->group(function () { Route::get('/dashboard', [AdminDashboardController::class, 'index'])->name('dashboard'); // Course Management Route::resource('courses', CourseController::class); // Module Management Route::resource('modules', ModuleController::class); // Lesson Management Route::resource('lessons', LessonController::class); }); // Student Routes Route::middleware(['auth', 'role:student'])->prefix('student')->name('student.')->group(function () { Route::get('/dashboard', [StudentDashboardController::class, 'index'])->name('dashboard'); // Course Management for Students Route::get('/courses/{course}', [StudentCourseController::class, 'show'])->name('courses.show'); Route::post('/courses/{course}/enroll', [StudentCourseController::class, 'enroll'])->name('courses.enroll'); Route::delete('/courses/{course}/unenroll', [StudentCourseController::class, 'unenroll'])->name('courses.unenroll'); // Lesson Learning Interface Route::get('/lessons/{lesson}', [StudentLessonController::class, 'show'])->name('lessons.show'); Route::post('/lessons/{lesson}/complete', [StudentLessonController::class, 'markCompleted'])->name('lessons.complete'); Route::post('/lessons/{lesson}/questions/{question}/answer', [StudentLessonController::class, 'answerQuestion'])->name('lessons.answer'); }); require __DIR__.'/auth.php';