33 lines
930 B
PHP
33 lines
930 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Club;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Product;
|
|
use App\Models\Recipe;
|
|
|
|
class FavoriteController extends Controller
|
|
{
|
|
/**
|
|
* Display a listing of the resource.
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
public function indexProducts(): \Illuminate\Contracts\View\View
|
|
{
|
|
$models = Product::query()->where('published', true)->take(15)->paginate(9);
|
|
return view('club.pages.favorites.products', compact('models'));
|
|
}
|
|
|
|
/**
|
|
* Display a listing of the resource.
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
public function indexRecipes(): \Illuminate\Contracts\View\View
|
|
{
|
|
$models = Recipe::query()->with('products', 'consumptionMoment')
|
|
->where('published', true)->take(15)->paginate(9);
|
|
return view('club.pages.favorites.recipes', compact('models'));
|
|
}
|
|
}
|