Core implementation: controllers, views, routes, models, import command
This commit is contained in:
+26
-3
@@ -1,16 +1,39 @@
|
||||
<?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;
|
||||
|
||||
Route::get('/', function () {
|
||||
return view('welcome');
|
||||
// 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 view('dashboard');
|
||||
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');
|
||||
|
||||
Reference in New Issue
Block a user