ldc-wenn-dann-mit-respekt/app/Http/Controllers/Fo/HomeController.php

27 lines
760 B
PHP

<?php
namespace App\Http\Controllers\Fo;
use App\Http\Controllers\Controller;
use App\Models\Home;
use App\Models\Slider;
class HomeController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Contracts\View\View
*/
public function index(): \Illuminate\Contracts\View\View
{
$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('home', 'sliders'));
}
}