public function index(Product $product)
 {
     $categories = Category::all()->toHierarchy()->toArray();
     return $this->view('category::{account}.product.categories', compact('product', 'categories'));
 }
예제 #2
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $categories = Category::all()->toHierarchy()->toArray();
     $view->with('categories', $categories);
 }