public function index() { $categories = CategoryProduct::all(); $this->data['categories'] = $categories; return view('manage.product.all', $this->data); }
public function edit_blog_post($id) { $product = Product::find($id); $this->data['product'] = $product; $this->data['categories'] = CategoryProduct::all(); $this->data['tags'] = Tag::all(); $this->data['owner_id'] = $this->user->id; return view('student.edit_blog_post', $this->data); }
public function product_categories($domain) { $categories = CategoryProduct::all()->map(function ($c) { return ['value' => $c->id, 'text' => $c->name]; }); return $this->respond(['categories' => $categories]); }