@@ -122,7 +122,7 @@ public function table(Table $table): Table
122122 }
123123
124124 if ($ search ) {
125- $ players = array_filter ($ players , fn ($ player ) => str ($ player ['player ' ])->contains ($ search , true ));
125+ $ players = array_filter ($ players , fn ($ player ) => str ($ player ['gq_name ' ])->contains ($ search , true ));
126126 }
127127
128128 return new LengthAwarePaginator (array_slice ($ players , ($ page - 1 ) * $ recordsPerPage , $ recordsPerPage ), count ($ players ), $ recordsPerPage , $ page );
@@ -137,21 +137,22 @@ public function table(Table $table): Table
137137 Split::make ([
138138 ImageColumn::make ('avatar ' )
139139 ->visible (fn () => $ isMinecraft )
140- ->state (fn (array $ record ) => 'https://cravatar.eu/helmhead/ ' . $ record ['player ' ] . '/256.png ' )
140+ ->state (fn (array $ record ) => 'https://cravatar.eu/helmhead/ ' . $ record ['gq_name ' ] . '/256.png ' )
141141 ->grow (false ),
142- TextColumn::make ('player ' )
142+ TextColumn::make ('gq_name ' )
143143 ->label ('Name ' )
144+ ->tooltip (fn (array $ record ) => array_key_exists ('id ' , $ record ) ? $ record ['id ' ] : null )
144145 ->searchable (),
145146 TextColumn::make ('is_whitelisted ' )
146147 ->visible (fn () => $ isMinecraft )
147148 ->badge ()
148149 ->grow (false )
149- ->state (fn (array $ record ) => in_array ($ record ['player ' ], $ whitelist ) ? trans ('player-counter::query.whitelisted ' ) : null ),
150+ ->state (fn (array $ record ) => in_array ($ record ['gq_name ' ], $ whitelist ) ? trans ('player-counter::query.whitelisted ' ) : null ),
150151 TextColumn::make ('is_op ' )
151152 ->visible (fn () => $ isMinecraft )
152153 ->badge ()
153154 ->grow (false )
154- ->state (fn (array $ record ) => in_array ($ record ['player ' ], $ ops ) ? trans ('player-counter::query.op ' ) : null ),
155+ ->state (fn (array $ record ) => in_array ($ record ['gq_name ' ], $ ops ) ? trans ('player-counter::query.op ' ) : null ),
155156 TextColumn::make ('time ' )
156157 ->hidden (fn () => $ isMinecraft )
157158 ->badge ()
@@ -169,11 +170,11 @@ public function table(Table $table): Table
169170 $ server = Filament::getTenant ();
170171
171172 try {
172- $ server ->send ('kick ' . $ record ['player ' ]);
173+ $ server ->send ('kick ' . $ record ['gq_name ' ]);
173174
174175 Notification::make ()
175176 ->title (trans ('player-counter::query.notifications.player_kicked ' ))
176- ->body ($ record ['player ' ])
177+ ->body ($ record ['gq_name ' ])
177178 ->success ()
178179 ->send ();
179180
@@ -190,21 +191,21 @@ public function table(Table $table): Table
190191 }),
191192 Action::make ('whitelist ' )
192193 ->visible (fn () => $ isMinecraft )
193- ->label (fn (array $ record ) => in_array ($ record ['player ' ], $ whitelist ) ? trans ('player-counter::query.remove_from_whitelist ' ) : trans ('player-counter::query.add_to_whitelist ' ))
194- ->icon (fn (array $ record ) => in_array ($ record ['player ' ], $ whitelist ) ? 'tabler-playlist-x ' : 'tabler-playlist-add ' )
195- ->color (fn (array $ record ) => in_array ($ record ['player ' ], $ whitelist ) ? 'danger ' : 'success ' )
194+ ->label (fn (array $ record ) => in_array ($ record ['gq_name ' ], $ whitelist ) ? trans ('player-counter::query.remove_from_whitelist ' ) : trans ('player-counter::query.add_to_whitelist ' ))
195+ ->icon (fn (array $ record ) => in_array ($ record ['gq_name ' ], $ whitelist ) ? 'tabler-playlist-x ' : 'tabler-playlist-add ' )
196+ ->color (fn (array $ record ) => in_array ($ record ['gq_name ' ], $ whitelist ) ? 'danger ' : 'success ' )
196197 ->action (function (array $ record ) use ($ whitelist ) {
197198 /** @var Server $server */
198199 $ server = Filament::getTenant ();
199200
200201 try {
201- $ action = in_array ($ record ['player ' ], $ whitelist ) ? 'remove ' : 'add ' ;
202+ $ action = in_array ($ record ['gq_name ' ], $ whitelist ) ? 'remove ' : 'add ' ;
202203
203- $ server ->send ('whitelist ' . $ action . ' ' . $ record ['player ' ]);
204+ $ server ->send ('whitelist ' . $ action . ' ' . $ record ['gq_name ' ]);
204205
205206 Notification::make ()
206207 ->title (trans ('player-counter::query.notifications.player_whitelist_ ' . $ action ))
207- ->body ($ record ['player ' ])
208+ ->body ($ record ['gq_name ' ])
208209 ->success ()
209210 ->send ();
210211
@@ -221,21 +222,21 @@ public function table(Table $table): Table
221222 }),
222223 Action::make ('op ' )
223224 ->visible (fn () => $ isMinecraft )
224- ->label (fn (array $ record ) => in_array ($ record ['player ' ], $ ops ) ? trans ('player-counter::query.remove_from_ops ' ) : trans ('player-counter::query.add_to_ops ' ))
225- ->icon (fn (array $ record ) => in_array ($ record ['player ' ], $ ops ) ? 'tabler-shield-minus ' : 'tabler-shield-plus ' )
226- ->color (fn (array $ record ) => in_array ($ record ['player ' ], $ ops ) ? 'warning ' : 'success ' )
225+ ->label (fn (array $ record ) => in_array ($ record ['gq_name ' ], $ ops ) ? trans ('player-counter::query.remove_from_ops ' ) : trans ('player-counter::query.add_to_ops ' ))
226+ ->icon (fn (array $ record ) => in_array ($ record ['gq_name ' ], $ ops ) ? 'tabler-shield-minus ' : 'tabler-shield-plus ' )
227+ ->color (fn (array $ record ) => in_array ($ record ['gq_name ' ], $ ops ) ? 'warning ' : 'success ' )
227228 ->action (function (array $ record ) use ($ ops ) {
228229 /** @var Server $server */
229230 $ server = Filament::getTenant ();
230231
231232 try {
232- $ action = in_array ($ record ['player ' ], $ ops ) ? 'deop ' : 'op ' ;
233+ $ action = in_array ($ record ['gq_name ' ], $ ops ) ? 'deop ' : 'op ' ;
233234
234- $ server ->send ($ action . ' ' . $ record ['player ' ]);
235+ $ server ->send ($ action . ' ' . $ record ['gq_name ' ]);
235236
236237 Notification::make ()
237238 ->title (trans ('player-counter::query.notifications.player_ ' . $ action ))
238- ->body ($ record ['player ' ])
239+ ->body ($ record ['gq_name ' ])
239240 ->success ()
240241 ->send ();
241242
0 commit comments