/** * Show the form for editing the specified resource. * * @param int $id * @param VatRateRepository $vat_rates * @return Response */ public function edit($id, VatRateRepository $vat_rates) { try { return view('vat-rates.edit')->with('model', $vat_rates->findById($id)); } catch (ModelNotFoundException $e) { flash()->warning(trans('vat-rates.not_found')); } return redirect()->route('vat-rates.index'); }
/** * Execute the command. * * @param VatRateRepository $vat_rates * @return VatRate */ public function handle(VatRateRepository $vat_rates) { $vat_rate = $vat_rates->findById($this->id)->fill($this->getProperties()); $vat_rates->save($vat_rate); return $vat_rate; }