@@ -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 | ->allowedAppends('full_path') |
| 112 | 112 | ->with('game') |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | public function getAllServers() |
| 135 | 135 | { |
| 136 | - $qb = QueryBuilder::for(Server::class) |
|
| 136 | + $qb = QueryBuilder::for (Server::class) |
|
| 137 | 137 | ->allowedFilters('ds_id') |
| 138 | 138 | ->allowedAppends('full_path') |
| 139 | 139 | ->with('game'); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | $query = DB::table($serversTable) |
| 175 | 175 | ->selectRaw("{$serversTable}.*, {$gamesTable}.name as game_name") |
| 176 | - ->whereIn('game_id', function ($query) use ($engines, $serversTable, $gamesTable): void { |
|
| 176 | + ->whereIn('game_id', function($query) use ($engines, $serversTable, $gamesTable): void { |
|
| 177 | 177 | $query->select('code') |
| 178 | 178 | ->from($gamesTable) |
| 179 | 179 | ->whereIn('engine', $engines); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | public function search($query) |
| 200 | 200 | { |
| 201 | 201 | return $this->model->select(['id', 'name', 'server_ip', 'server_port', 'game_id', 'game_mod_id']) |
| 202 | - ->with(['game' => function ($query): void { |
|
| 202 | + ->with(['game' => function($query): void { |
|
| 203 | 203 | $query->select('code', 'name'); |
| 204 | 204 | }]) |
| 205 | 205 | ->where('name', 'LIKE', '%' . $query . '%') |
@@ -212,9 +212,9 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | public function update(Server $server, array $attributes): void |
| 214 | 214 | { |
| 215 | - $attributes['enabled'] = (bool)array_key_exists('enabled', $attributes); |
|
| 216 | - $attributes['blocked'] = (bool)array_key_exists('blocked', $attributes); |
|
| 217 | - $attributes['installed'] = (bool)array_key_exists('installed', $attributes); |
|
| 215 | + $attributes['enabled'] = (bool) array_key_exists('enabled', $attributes); |
|
| 216 | + $attributes['blocked'] = (bool) array_key_exists('blocked', $attributes); |
|
| 217 | + $attributes['installed'] = (bool) array_key_exists('installed', $attributes); |
|
| 218 | 218 | |
| 219 | 219 | if (isset($attributes['ds_id'])) { |
| 220 | 220 | $server->ds_id = $attributes['ds_id']; |
@@ -106,11 +106,12 @@ 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 | ->allowedAppends('full_path') |
| 112 | 112 | ->with('game') |
| 113 | 113 | ->whereRaw('id IN(SELECT server_id FROM server_user su WHERE su.user_id = ?)', [$userId]); |
| 114 | + } |
|
| 114 | 115 | |
| 115 | 116 | return $qb->get([ |
| 116 | 117 | 'id', |
@@ -133,10 +134,11 @@ discard block |
||
| 133 | 134 | |
| 134 | 135 | public function getAllServers() |
| 135 | 136 | { |
| 136 | - $qb = QueryBuilder::for(Server::class) |
|
| 137 | - ->allowedFilters('ds_id') |
|
| 137 | + $qb = QueryBuilder::for(Server::class) { |
|
| 138 | + ->allowedFilters('ds_id') |
|
| 138 | 139 | ->allowedAppends('full_path') |
| 139 | 140 | ->with('game'); |
| 141 | + } |
|
| 140 | 142 | |
| 141 | 143 | return $qb->get([ |
| 142 | 144 | 'id', |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function create() |
| 55 | 55 | { |
| 56 | 56 | $roles = $this->bouncer->role()->all(); |
| 57 | - $roleOptions = $roles->map(function ($item) { |
|
| 57 | + $roleOptions = $roles->map(function($item) { |
|
| 58 | 58 | return [ |
| 59 | 59 | 'label' => $item->title, |
| 60 | 60 | 'value' => $item->name, |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | public function edit(User $user) |
| 102 | 102 | { |
| 103 | 103 | $roles = $this->bouncer->role()->all(); |
| 104 | - $roleOptions = $roles->map(function ($item) { |
|
| 104 | + $roleOptions = $roles->map(function($item) { |
|
| 105 | 105 | return [ |
| 106 | 106 | 'label' => $item->title, |
| 107 | 107 | 'value' => $item->name, |