<?php

namespace TPS\Shop\Repositories;

class CategoryRepository extends \Webkul\Category\Repositories\CategoryRepository
{
    public function getPathCategories($category): array
    {
        $categories = [];

        while (isset($category->parent)) {
            $category = $category->parent;
            $categories[] = $category;
        }

        return array_reverse($categories);
    }
}