Files
gamelog/routes/web.php
T

44 lines
1.9 KiB
PHP

<?php
use App\Http\Controllers\GameController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\LibraryController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\UserController;
use Illuminate\Support\Facades\Route;
// Home
Route::get('/', [HomeController::class, 'index'])->name('home');
// Games (public)
Route::get('/games', [GameController::class, 'index'])->name('games.index');
Route::get('/games/search', [GameController::class, 'search'])->name('games.search');
Route::get('/top-rated', [GameController::class, 'topRated'])->name('games.top-rated');
Route::get('/new-releases', [GameController::class, 'newReleases'])->name('games.new-releases');
Route::get('/games/{game:slug}', [GameController::class, 'show'])->name('games.show');
// User profiles (public)
Route::get('/users/{user:username}', [UserController::class, 'show'])->name('users.show');
Route::get('/users/{user:username}/library', [UserController::class, 'library'])->name('users.library');
// Library (auth required)
Route::middleware('auth')->group(function () {
Route::post('/library', [LibraryController::class, 'store'])->name('library.store');
Route::put('/library/{userGame}', [LibraryController::class, 'update'])->name('library.update');
Route::delete('/library/{userGame}', [LibraryController::class, 'destroy'])->name('library.destroy');
});
// Dashboard (Breeze default, keep for now)
Route::get('/dashboard', function () {
return redirect()->route('home');
})->middleware(['auth', 'verified'])->name('dashboard');
// Profile (Breeze)
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';