43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Enums\OCBType;
|
|
use App\Models\OCBBreeder;
|
|
|
|
class OCBController extends Controller
|
|
{
|
|
public function testimonials()
|
|
{
|
|
$breeders = OCBBreeder::ocbValidated()->select('slug', 'picture', 'first_name', 'last_name')
|
|
->inRandomOrder()->limit(8)->get();
|
|
|
|
return view('front.ocb.testimonials', compact('breeders'));
|
|
}
|
|
|
|
public function breeder(OCBBreeder $breeder)
|
|
{
|
|
// Contient les images de l'exploitation de l'éleveur
|
|
$pictures = [];
|
|
if ($breeder->site !== null && $breeder->site->presentation_type === 2) {
|
|
if ($breeder->site->picture1 !== null) {
|
|
$pictures[] = $breeder->site->picture1;
|
|
}
|
|
if ($breeder->site->picture2 !== null) {
|
|
$pictures[] = $breeder->site->picture2;
|
|
}
|
|
if ($breeder->site->picture3 !== null) {
|
|
$pictures[] = $breeder->site->picture3;
|
|
}
|
|
}
|
|
|
|
return view('front.ocb.breeder', compact('breeder', 'pictures'));
|
|
}
|
|
|
|
public function poultry()
|
|
{
|
|
$breeder = OCBBreeder::inRandomOrder()->first();
|
|
$ocbType = OCBType::poultry();
|
|
return view('front.ocb.poultry', compact('breeder', 'ocbType'));
|
|
}
|
|
}
|