Ejemplo n.º 1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $notification = Notification::whereId($id)->first();
     if (empty($notification)) {
         return $this->saveResponse(false);
     }
     return $this->saveResponse($notification->delete());
 }
 /**
  * Handle the command.
  *
  * @param  UpdateNotificationCommand  $command
  * @return void
  */
 public function handle(UpdateNotificationCommand $command)
 {
     $notification = Notification::whereId($command->id)->first();
     if (!empty($notification)) {
         $notification->notified = $command->notified;
         $notification->alarm = $command->alarm;
         if ($notification->save()) {
             return $notification;
         }
     }
     return false;
 }