30 lines
894 B
PHP
30 lines
894 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Fo;
|
|
|
|
use App\Enums\StaticPageType;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Home;
|
|
use App\Models\Slider;
|
|
use App\Models\StaticPage;
|
|
|
|
class HomeController extends Controller
|
|
{
|
|
/**
|
|
* Display a listing of the resource.
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
public function index(): \Illuminate\Contracts\View\View
|
|
{
|
|
$staticPageModel = StaticPage::query()->where('type', StaticPageType::home)->firstOrFail();
|
|
$currentLocale = app()->currentLocale();
|
|
$home = Home::query()->firstOrFail();
|
|
$sliders = Slider::query()
|
|
->where('status', true)
|
|
->orderBy('order')
|
|
->whereJsonContains('locales', $currentLocale)
|
|
->get();
|
|
return view('fo.pages.home', compact('staticPageModel', 'home', 'sliders'));
|
|
}
|
|
}
|