27 lines
826 B
PHP
27 lines
826 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Fo;
|
|
|
|
use App\Enums\StaticPageType;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\KlubBloc;
|
|
use App\Models\News;
|
|
use App\Models\Range;
|
|
use App\Models\StaticPage;
|
|
|
|
class HomeController extends Controller
|
|
{
|
|
/**
|
|
* Display the homepage.
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
public function index(): \Illuminate\Contracts\View\View
|
|
{
|
|
$rangeModels = Range::all();
|
|
$klubBloc = KlubBloc::first();
|
|
$newsModels = News::query()->where('published', true)->orderBy('created_at', 'desc')->limit(6)->get();
|
|
$staticPageModel = StaticPage::query()->where('type', StaticPageType::home)->first();
|
|
return view('fo.pages.home', compact('staticPageModel', 'rangeModels', 'klubBloc', 'newsModels'));
|
|
}
|
|
}
|