ldc-nature-and-respect/app/View/Components/RecipeProductStoerer.php

46 lines
861 B
PHP
Raw Permalink Normal View History

2023-04-05 08:44:33 +00:00
<?php
namespace App\View\Components;
use Illuminate\View\Component;
use App\Models\Product;
class RecipeProductStoerer extends Component
{
/**
* id variable
*
* @var integer
*/
public $id;
/**
* product variable
*
2024-01-29 16:02:03 +01:00
* @var \App\Models\Product
2023-04-05 08:44:33 +00:00
*/
public $product;
/**
* Create a new component instance.
*
* @param integer $id
* @return void
*/
public function __construct(int $id)
{
2024-01-29 16:02:03 +01:00
$this->product = Product::query()->where('id', $id)->first();
2023-04-05 08:44:33 +00:00
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render()
{
$product = $this->product;
return view('fo.components.recipe-product-stoerer', compact('product'));
}
}