Ejemplo n.º 1
0
 /**
  * Handle the command.
  *
  * @param  UpdateShopCommand  $command
  * @return void
  */
 public function handle(UpdateShopCommand $command)
 {
     $shop = Shop::whereId($command->id)->first();
     if (!empty($shop)) {
         $shop->scheduled = $command->scheduled;
         $shop->title = $command->title;
         $shop->amount = $command->amount;
         $shop->reimbursement = $command->reimbursement;
         $shop->postcode = $command->postcode;
         $shop->description = $command->description;
         $shop->proof = $command->proof;
         //$shop->payment = $command->payment;
         $shop->client_id = $command->client_id;
         $shop->key_id = $command->key_id;
         if ($shop->save()) {
             return $shop;
         }
     }
     return false;
 }
Ejemplo n.º 2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $shop = Shop::whereId($id)->first();
     if (empty($shop)) {
         return $this->saveResponse(false);
     }
     return $this->saveResponse($shop->delete());
 }