예제 #1
0
 /**
  * Show edit form
  *
  * @return Response View
  */
 public function getEdit($id)
 {
     \Assets::addJavascript(['fancybox', 'ckeditor', 'bootstrap-tagsinput', 'floatThead', 'typeahead', 'uploader']);
     \Assets::addStylesheets(['bootstrap-tagsinput', 'floatThead', 'fancybox']);
     \Assets::addAppModule(['ckeditor', 'tags', 'media', 'product', 'slug']);
     $this->registerMediaLibrary();
     $product = $this->productRepository->findById($id);
     $notes = $product->notes()->get();
     $tags = $product->tags->lists('name')->all();
     $tags = implode(',', $tags);
     $provinces = Province::whereActive(1)->lists('name', 'id');
     return view('product::edit', compact('product', 'notes', 'tags', 'provinces'));
 }
예제 #2
0
 public function findById($id)
 {
     return Province::where('id', $id)->first();
 }