50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Enums\PoultryPageType;
|
|
use App\Models\Ads;
|
|
use App\Models\OCBBreeder;
|
|
use App\Models\PoultryPage;
|
|
use Illuminate\Support\Facades\View;
|
|
|
|
class BrandController extends Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
View::share('poultryPageMenu', PoultryPage::get(['type', 'menutitle']));
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$breeder = OCBBreeder::where('status', true)
|
|
->where('picture', '!=', '')->inRandomOrder()->first();
|
|
return view('front.brand.index', compact('breeder'));
|
|
}
|
|
|
|
public function ads()
|
|
{
|
|
$ads = Ads::where('status', true)->orderBy('created_at', 'DESC')->get();
|
|
return view('front.brand.ads', compact('ads'));
|
|
}
|
|
|
|
/**
|
|
* @source /lamarque/eleveurs-engagés
|
|
* @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
|
|
*/
|
|
public function engage()
|
|
{
|
|
$page = PoultryPage::where('type', PoultryPageType::engage())->first();
|
|
return view('front.brand.poultry-page.engage', compact('page'));
|
|
}
|
|
|
|
/**
|
|
* @source /lamarque/production-tracable
|
|
* @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
|
|
*/
|
|
public function tracable()
|
|
{
|
|
$page = PoultryPage::where('type', PoultryPageType::tracable())->first();
|
|
return view('front.brand.poultry-page.tracable', compact('page'));
|
|
}
|
|
}
|