2024-03-30 15:47:48 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\View\Composers;
|
|
|
|
|
2024-06-02 22:09:52 +03:00
|
|
|
use App\Models\Mall\MallCategory;
|
2024-03-30 15:47:48 +02:00
|
|
|
use Illuminate\View\View;
|
|
|
|
|
2024-06-02 22:09:52 +03:00
|
|
|
class MallComposer
|
2024-03-30 15:47:48 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bind data to the view.
|
|
|
|
*/
|
|
|
|
public function compose(View $view): void
|
|
|
|
{
|
|
|
|
// Fetch the amount of items in storage
|
|
|
|
$view->with('storageCount', 10);
|
|
|
|
|
|
|
|
// Fetch the amount of items in storage
|
|
|
|
$view->with('discountDesc', "20% reducere la chipsuri");
|
|
|
|
|
2024-06-02 22:09:52 +03:00
|
|
|
// Fetch the mall categories
|
|
|
|
$view->with('categories', MallCategory::all());
|
2024-03-30 15:47:48 +02:00
|
|
|
}
|
|
|
|
}
|