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
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Controllers;
use App\Models\Game;
class HomeController extends Controller
{
public function index()
{
$topRated = Game::published()
->where('rating_count', '>=', 1)
->orderByDesc('rating_avg')
->orderByDesc('rating_count')
->limit(12)
->get();
$newReleases = Game::published()
->whereNotNull('release_date')
->where('release_date', '<=', now())
->orderByDesc('release_date')
->limit(8)
->get();
return view('home', compact('topRated', 'newReleases'));
}
}