Ejemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param int $id
  * @param ShippingRuleRepository $rules
  * @return Response
  */
 public function edit($id, ShippingRuleRepository $rules)
 {
     try {
         return view('shipping-rules.edit')->with('model', $rules->findById($id));
     } catch (ModelNotFoundException $e) {
         flash()->warning(trans('shipping-rules.not_found'));
         return redirect()->route('shipping-rule.index');
     }
 }
Ejemplo n.º 2
0
 /**
  * Execute the command.
  *
  * @param ShippingRuleRepository $rules
  * @return ShippingRule
  */
 public function handle(ShippingRuleRepository $rules)
 {
     $rule = $rules->findById($this->id)->fill($this->getProperties());
     $rules->save($rule);
     return $rule;
 }