/**
  * Show the form for editing the specified resource.
  *
  * @param int $id
  * @param SupplierRepository $suppliers
  * @return Response
  */
 public function edit($id, SupplierRepository $suppliers)
 {
     try {
         return view('suppliers.edit')->with('model', $suppliers->findById($id));
     } catch (ModelNotFoundException $e) {
         flash()->warning(trans('suppliers.not_found'));
         return redirect()->route('supplier.index');
     }
 }
Beispiel #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param int $id
  * @param ProductRepository $products
  * @param SupplierRepository $suppliers
  * @param VatRateRepository $vat_rates
  * @return Response
  */
 public function edit($id, ProductRepository $products, SupplierRepository $suppliers, VatRateRepository $vat_rates)
 {
     try {
         $product = $products->findById($id);
         return view('products.edit')->with('model', $product)->with('suppliers', $suppliers->all())->with('vat_rates', $vat_rates->all());
     } catch (ModelNotFoundException $e) {
         flash() - warning(trans('products.not_found'));
         return redirect()->route('product.index');
     }
 }
 /**
  * Execute the command.
  *
  * @param SupplierRepository $suppliers
  * @return Paginator
  */
 public function handle(SupplierRepository $suppliers)
 {
     return $suppliers->query($this->q);
 }
 /**
  * Execute the command.
  *
  * @param SupplierRepository $suppliers
  * @return Supplier
  */
 public function handle(SupplierRepository $suppliers)
 {
     $supplier = Supplier::register($this->name);
     $suppliers->save($supplier);
     return $supplier;
 }
 /**
  * Execute the command.
  *
  * @param SupplierRepository $suppliers
  * @return Supplier
  */
 public function handle(SupplierRepository $suppliers)
 {
     $supplier = $suppliers->findById($this->id)->fill($this->getProperties());
     $suppliers->save($supplier);
     return $supplier;
 }