ldc-legaulois/app/Http/Controllers/BrandController.php
2022-01-28 09:39:23 +01:00

44 lines
1.2 KiB
PHP

<?php
namespace App\Http\Controllers;
use App\Enums\PoultryPageType;
use App\Models\Ads;
use App\Models\OCBBreeder;
use App\Models\PoultryPage;
class BrandController extends Controller
{
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'));
}
}