示例#1
0
 /**
  * Create a new instance of BaseController class.
  *
  * @param $notificationRepo
  * @param $messageRepo
  * @return void
  */
 public function __construct(TypeInterface $typeRepo)
 {
     $types = $typeRepo->getList();
     $data = ['types' => $types];
     view()->share($data);
 }
示例#2
0
 /**
  * Render view for product editing.
  * GET /admin/edit-product/{id}
  *
  * @param  integer $id
  * @param  ProductInterface $productRepo
  * @param  TypeInterface $typeRepo
  * @return view
  */
 public function getEditProduct($id, ProductInterface $productRepo, TypeInterface $typeRepo)
 {
     $product = $productRepo->getOne($id);
     $types = $typeRepo->getList();
     $typeData = [];
     foreach ($types as $type) {
         $typeData[$type->id] = $type->name;
     }
     $data = ['bodyClass' => 'skin-3 no-skin', 'action' => 'edit', 'types' => $typeData, 'productData' => $product, 'product' => true, 'id' => $id];
     return view('admin.product.add-edit-product', $data);
 }