2026-05-29 00:33:00 +03:00
|
|
|
<?php
|
|
|
|
|
|
2026-05-29 09:37:07 +03:00
|
|
|
use App\Http\Controllers\GameController;
|
|
|
|
|
use App\Http\Controllers\HomeController;
|
|
|
|
|
use App\Http\Controllers\LibraryController;
|
2026-05-29 00:33:00 +03:00
|
|
|
use App\Http\Controllers\ProfileController;
|
2026-05-29 09:37:07 +03:00
|
|
|
use App\Http\Controllers\UserController;
|
2026-05-29 00:33:00 +03:00
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
2026-05-29 09:37:07 +03:00
|
|
|
// 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');
|
2026-05-29 00:33:00 +03:00
|
|
|
});
|
|
|
|
|
|
2026-05-29 09:37:07 +03:00
|
|
|
// Dashboard (Breeze default, keep for now)
|
2026-05-29 00:33:00 +03:00
|
|
|
Route::get('/dashboard', function () {
|
2026-05-29 09:37:07 +03:00
|
|
|
return redirect()->route('home');
|
2026-05-29 00:33:00 +03:00
|
|
|
})->middleware(['auth', 'verified'])->name('dashboard');
|
|
|
|
|
|
2026-05-29 09:37:07 +03:00
|
|
|
// Profile (Breeze)
|
2026-05-29 00:33:00 +03:00
|
|
|
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';
|