38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Enums\BreedingPageType;
|
|
use App\Enums\GeneralConfigType;
|
|
use App\Models\BreedingPage;
|
|
use Illuminate\Support\Facades\View;
|
|
|
|
class BreedingPageController extends Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
$generalConfig = app()->view->getShared()['GeneralConfigGlobal'] ?? null;
|
|
if ($generalConfig) {
|
|
View::share('generalConfig', $generalConfig
|
|
->where('type', GeneralConfigType::breedingPage())
|
|
->first());
|
|
}
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
return view('front.breeding-page.index');
|
|
}
|
|
|
|
public function list(BreedingPageType $pagesType)
|
|
{
|
|
$pages = BreedingPage::where('type', $pagesType)->get();
|
|
return view('front.breeding-page.list', compact('pages', 'pagesType'));
|
|
}
|
|
|
|
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed
|
|
public function show(BreedingPageType $pagesType, BreedingPage $page)
|
|
{
|
|
return view('front.breeding-page.show', compact('page', 'pagesType'));
|
|
}
|
|
}
|