Core implementation: controllers, views, routes, models, import command

This commit is contained in:
Mark
2026-05-29 09:37:07 +03:00
parent 8e1fe4a2f5
commit 5813bc779a
24 changed files with 1361 additions and 37 deletions
+26 -3
View File
@@ -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');