eledana/routes/web.php
albert 610eebf66a
All checks were successful
Build, push and deploy / builds (push) Successful in 5s
add faults (routes, model, navigation, seeder and migration)
2024-11-08 16:39:01 +01:00

37 lines
1.1 KiB
PHP

<?php
use App\Http\Controllers\ProfileController;
use Illuminate\Support\Facades\Route;
use App\Models\User;
use App\Models\Fault;
Route::get('/', function () {
return view('home');
});
Route::get('/dashboard', function () {
$users = \App\Models\User::all();
return view('dashboard.index', compact('users'));
})->middleware(['auth', 'verified'])->name('dashboard');
// Subroute for users under /dashboard/users
Route::get('/dashboard/users', function () {
$users = \App\Models\User::all();
return view('dashboard.users', compact('users'));
})->name('dashboard.users');
Route::get('/dashboard/faults', function () {
$faults = \App\Models\Fault::all();
return view('dashboard.faults', compact('faults'));
})->name('dashboard.faults');
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');
});
require __DIR__.'/auth.php';