125 lines
4.7 KiB
PHP
125 lines
4.7 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Fo;
|
|
|
|
use App\Enums\Advices\AdviceTypeEnum;
|
|
use App\Enums\ExpertiseProducts\ExpertiseProductPageEnum;
|
|
use App\Enums\Products\ProductSpeciesEnum;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Advice;
|
|
use App\Models\ExpertiseProduct;
|
|
use App\Models\Product;
|
|
|
|
class ExpertiseController extends Controller
|
|
{
|
|
/**
|
|
* Undocumented function
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*
|
|
*/
|
|
public function canard(): \Illuminate\Contracts\View\View
|
|
{
|
|
// Get VIP Products for this page.
|
|
$vip = ExpertiseProduct::query()->where('page', ExpertiseProductPageEnum::duck->value())->get();
|
|
$products = Product::query()->where('status', true)
|
|
->where('species', ProductSpeciesEnum::canard->value())
|
|
->inRandomOrder()
|
|
->limit(3)
|
|
->with('subrange.range')
|
|
->get();
|
|
$recipes = Advice::query()->whereHas('products', function ($query) {
|
|
return $query->where('species', ProductSpeciesEnum::canard->value());
|
|
})->where('type', AdviceTypeEnum::recipes)->limit(3)->get();
|
|
|
|
return view('fo.pages.expertise.canard', compact('vip', 'products', 'recipes'));
|
|
}
|
|
|
|
/**
|
|
* Undocumented function
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
public function dinde(): \Illuminate\Contracts\View\View
|
|
{
|
|
// Get VIP Products for this page.
|
|
$vip = ExpertiseProduct::query()->where('page', ExpertiseProductPageEnum::turkey->value())->get();
|
|
$products = Product::query()->where('status', true)
|
|
->where('species', ProductSpeciesEnum::dinde->value())
|
|
->inRandomOrder()
|
|
->limit(3)
|
|
->with('subrange.range')
|
|
->get();
|
|
$recipes = Advice::query()->whereHas('products', function ($query) {
|
|
return $query->where('species', ProductSpeciesEnum::dinde->value());
|
|
})->where('type', AdviceTypeEnum::recipes)->limit(3)->get();
|
|
|
|
return view('fo.pages.expertise.dinde', compact('vip', 'products', 'recipes'));
|
|
}
|
|
|
|
/**
|
|
* Undocumented function
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
public function lapin(): \Illuminate\Contracts\View\View
|
|
{
|
|
// Get VIP Products for this page.
|
|
$vip = ExpertiseProduct::query()->where('page', ExpertiseProductPageEnum::rabbit->value())->get();
|
|
$products = Product::query()->where('status', true)
|
|
->where('species', ProductSpeciesEnum::lapin->value())
|
|
->inRandomOrder()
|
|
->limit(3)
|
|
->with('subrange.range')
|
|
->get();
|
|
$recipes = Advice::query()->whereHas('products', function ($query) {
|
|
return $query->where('species', ProductSpeciesEnum::lapin->value());
|
|
})->where('type', AdviceTypeEnum::recipes)->limit(3)->get();
|
|
|
|
return view('fo.pages.expertise.lapin', compact('vip', 'products', 'recipes'));
|
|
}
|
|
|
|
/**
|
|
* Undocumented function
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
public function pintade(): \Illuminate\Contracts\View\View
|
|
{
|
|
// Get VIP Products for this page.
|
|
$vip = ExpertiseProduct::query()->where('page', ExpertiseProductPageEnum::guineafowl->value())->get();
|
|
$products = Product::query()->where('status', true)
|
|
->where('species', ProductSpeciesEnum::pintade->value())
|
|
->inRandomOrder()
|
|
->limit(3)
|
|
->with('subrange.range')
|
|
->get();
|
|
$recipes = Advice::query()->whereHas('products', function ($query) {
|
|
return $query->where('species', ProductSpeciesEnum::pintade->value());
|
|
})->where('type', AdviceTypeEnum::recipes)->limit(3)->get();
|
|
|
|
return view('fo.pages.expertise.pintade', compact('vip', 'products', 'recipes'));
|
|
}
|
|
|
|
/**
|
|
* Undocumented function
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
public function poulet(): \Illuminate\Contracts\View\View
|
|
{
|
|
// Get VIP Products for this page.
|
|
$vip = ExpertiseProduct::query()->where('page', ExpertiseProductPageEnum::chicken->value())->get();
|
|
$products = Product::query()->where('status', true)
|
|
->where('species', ProductSpeciesEnum::poulet->value())
|
|
->inRandomOrder()
|
|
->limit(3)
|
|
->with('subrange.range')
|
|
->get();
|
|
$recipes = Advice::query()->whereHas('products', function ($query) {
|
|
return $query->where('species', ProductSpeciesEnum::poulet->value());
|
|
})->where('type', AdviceTypeEnum::recipes)->limit(3)->get();
|
|
|
|
return view('fo.pages.expertise.poulet', compact('vip', 'products', 'recipes'));
|
|
}
|
|
}
|