| @@ -106,7 +106,7 @@ discard block | ||
| 106 | 106 | |
| 107 | 107 | public function getServersForUser(int $userId) | 
| 108 | 108 |      { | 
| 109 | - $qb = QueryBuilder::for(Server::class) | |
| 109 | + $qb = QueryBuilder::for (Server::class) | |
| 110 | 110 |              ->allowedFilters('ds_id') | 
| 111 | 111 |              ->with('game:code,name,engine,engine_version') | 
| 112 | 112 |              ->whereRaw('id IN(SELECT server_id FROM server_user su WHERE su.user_id = ?)', [$userId]); | 
| @@ -132,7 +132,7 @@ discard block | ||
| 132 | 132 | |
| 133 | 133 | public function getAllServers() | 
| 134 | 134 |      { | 
| 135 | - $qb = QueryBuilder::for(Server::class) | |
| 135 | + $qb = QueryBuilder::for (Server::class) | |
| 136 | 136 |              ->allowedFilters('ds_id') | 
| 137 | 137 | ->allowedAppends(['full_path', 'is_online']) | 
| 138 | 138 |              ->with('game:code,name,engine,engine_version'); | 
| @@ -171,7 +171,7 @@ discard block | ||
| 171 | 171 | |
| 172 | 172 | $query = DB::table($serversTable) | 
| 173 | 173 |              ->selectRaw("{$serversTable}.*, {$gamesTable}.name as game_name") | 
| 174 | -            ->whereIn('game_id', function ($query) use ($engines, $serversTable, $gamesTable): void { | |
| 174 | +            ->whereIn('game_id', function($query) use ($engines, $serversTable, $gamesTable): void { | |
| 175 | 175 |                  $query->select('code') | 
| 176 | 176 | ->from($gamesTable) | 
| 177 | 177 |                      ->whereIn('engine', $engines); | 
| @@ -197,7 +197,7 @@ discard block | ||
| 197 | 197 | public function search($query) | 
| 198 | 198 |      { | 
| 199 | 199 | return $this->model->select(['id', 'name', 'server_ip', 'server_port', 'game_id', 'game_mod_id']) | 
| 200 | -            ->with(['game' => function ($query): void { | |
| 200 | +            ->with(['game' => function($query): void { | |
| 201 | 201 |                  $query->select('code', 'name'); | 
| 202 | 202 | }]) | 
| 203 | 203 |              ->where('name', 'LIKE', '%' . $query . '%') | 
| @@ -210,9 +210,9 @@ discard block | ||
| 210 | 210 | */ | 
| 211 | 211 | public function update(Server $server, array $attributes): void | 
| 212 | 212 |      { | 
| 213 | -        $attributes['enabled']   = (bool)array_key_exists('enabled', $attributes); | |
| 214 | -        $attributes['blocked']   = (bool)array_key_exists('blocked', $attributes); | |
| 215 | -        $attributes['installed'] = (bool)array_key_exists('installed', $attributes); | |
| 213 | +        $attributes['enabled']   = (bool) array_key_exists('enabled', $attributes); | |
| 214 | +        $attributes['blocked']   = (bool) array_key_exists('blocked', $attributes); | |
| 215 | +        $attributes['installed'] = (bool) array_key_exists('installed', $attributes); | |
| 216 | 216 | |
| 217 | 217 |          if (isset($attributes['ds_id'])) { | 
| 218 | 218 | $server->ds_id = $attributes['ds_id']; | 
| @@ -106,10 +106,11 @@ discard block | ||
| 106 | 106 | |
| 107 | 107 | public function getServersForUser(int $userId) | 
| 108 | 108 |      { | 
| 109 | - $qb = QueryBuilder::for(Server::class) | |
| 110 | -            ->allowedFilters('ds_id') | |
| 109 | +        $qb = QueryBuilder::for(Server::class) { | |
| 110 | +                    ->allowedFilters('ds_id') | |
| 111 | 111 |              ->with('game:code,name,engine,engine_version') | 
| 112 | 112 |              ->whereRaw('id IN(SELECT server_id FROM server_user su WHERE su.user_id = ?)', [$userId]); | 
| 113 | + } | |
| 113 | 114 | |
| 114 | 115 | return $qb->get([ | 
| 115 | 116 | 'id', | 
| @@ -132,10 +133,11 @@ discard block | ||
| 132 | 133 | |
| 133 | 134 | public function getAllServers() | 
| 134 | 135 |      { | 
| 135 | - $qb = QueryBuilder::for(Server::class) | |
| 136 | -            ->allowedFilters('ds_id') | |
| 136 | +        $qb = QueryBuilder::for(Server::class) { | |
| 137 | +                    ->allowedFilters('ds_id') | |
| 137 | 138 | ->allowedAppends(['full_path', 'is_online']) | 
| 138 | 139 |              ->with('game:code,name,engine,engine_version'); | 
| 140 | + } | |
| 139 | 141 | |
| 140 | 142 | return $qb->get([ | 
| 141 | 143 | 'id', |