Created
July 8, 2020 18:53
-
-
Save ghermans/f3f11a29b8feb557a75a6ec0fe8d5635 to your computer and use it in GitHub Desktop.
Get all categories in Bagisto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@php | |
$categories = []; | |
foreach (app('Webkul\Category\Repositories\CategoryRepository')->getVisibleCategoryTree(core()->getCurrentChannel()->root_category_id) as $category) { | |
if ($category->slug) | |
array_push($categories, $category); | |
} | |
@endphp | |
<ul> | |
@foreach($categories as $category_data) | |
<li>{{ $category_data->name }}</li> | |
@endforeach | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment