34 lines
993 B
PHP
34 lines
993 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Breeders;
|
|
use Illuminate\Http\Request;
|
|
|
|
class OCBController extends Controller
|
|
{
|
|
public function index() {
|
|
//
|
|
}
|
|
|
|
public function breeder($slug) {
|
|
$breeder = Breeders::where('slug', $slug)->first();
|
|
// Contient les images de l'exploitation de l'éleveur
|
|
$pictures = [];
|
|
if ($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 = Breeders::inRandomOrder()->first();
|
|
return view('front.ocb.poultry', compact('breeder'));
|
|
}
|
|
}
|