ldc-wenn-dann-mit-respekt/app/View/Components/RecipeProductStoerer.php
Vincent BRIDIER 2aa73fa32c Clean + CI/CD
2022-12-23 17:24:09 +00:00

45 lines
835 B
PHP

<?php
namespace App\View\Components;
use Illuminate\View\Component;
use App\Product;
class RecipeProductStoerer extends Component
{
/**
* id variable
*
* @var integer
*/
public $id;
/**
* product variable
*
* @var \App\Product
*/
public $product;
/**
* Create a new component instance.
*
* @param integer $id
* @return void
*/
public function __construct(int $id)
{
$this->product = Product::where('id', $id)->first();
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render()
{
$product = $this->product;
return view('components.recipe-product-stoerer', compact('product'));
}
}