Exemplo n.º 1
0
 /**
  * Run the Update
  */
 public function call()
 {
     $result = $this->setScope('server')->getPheal()->ServerStatus();
     if (StatusModel::orderBy('currentTime', 'desc')->value('currentTime') != $result->request_time) {
         StatusModel::create(['currentTime' => $result->request_time, 'serverOpen' => $result->serverOpen, 'onlinePlayers' => $result->onlinePlayers]);
     }
     return;
 }
Exemplo n.º 2
0
 /**
  * Get the last server status
  *
  * @return mixed
  */
 public function getEveLastServerStatus()
 {
     return ServerStatus::orderBy('created_at', 'desc')->first();
 }
Exemplo n.º 3
0
 /**
  * Get the data for the notification.
  */
 protected function getData() : Collection
 {
     return ServerStatus::orderBy('currentTime', 'desc')->take(1)->get();
 }
Exemplo n.º 4
0
 /**
  * @param int $limit
  *
  * @return mixed
  */
 public function getEveServerStatuses(int $limit = 200)
 {
     return ServerStatus::orderBy('created_at', 'desc')->take($limit)->get();
 }