FleetCart/Themes/Storefront/Http/ViewComposers/StorefrontTabsComposer.php

30 lines
562 B
PHP
Raw Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace Themes\Storefront\Http\ViewComposers;
2023-12-03 14:07:47 +00:00
use Illuminate\View\View;
2023-06-11 12:14:03 +00:00
use Modules\Category\Entities\Category;
class StorefrontTabsComposer
{
/**
* Bind data to the view.
*
2023-12-03 14:07:47 +00:00
* @param View $view
*
2023-06-11 12:14:03 +00:00
* @return void
*/
public function compose($view)
{
$view->with([
'categories' => $this->getCategories(),
]);
}
2023-12-03 14:07:47 +00:00
2023-06-11 12:14:03 +00:00
private function getCategories()
{
return ['' => trans('admin::admin.form.please_select')] + Category::treeList();
}
}