Exemplo 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');
     }
 }
 /**
  * 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;
 }
 /**
  * Execute the command.
  *
  * @param ShippingRuleRepository $rules
  * @return ShippingRule
  */
 public function handle(ShippingRuleRepository $rules)
 {
     $rule = ShippingRule::register($this->carrier_id, $this->country_id);
     $rules->save($rule);
     return $rule;
 }
 /**
  * Execute the command.
  *
  * @return void
  */
 public function handle(ShippingRuleRepository $rules)
 {
     return $rules->all();
 }