File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -153,15 +153,23 @@ public static function table(Table $table): Table
153
153
])
154
154
->filters ([
155
155
SelectFilter::make ('author_id ' )
156
+ ->label (__ ('filament-latex::filament-latex.column.author.name ' ))
156
157
->default (fn () => Auth::id ())
157
158
->options (fn () => $ userModel ::all ()->pluck ('name ' , 'id ' ))
158
- ->multiple ()
159
- ->preload (),
159
+ ->native (false ),
160
160
SelectFilter::make ('collaborators_id ' )
161
- ->default ( fn () => [Auth:: id ()] )
161
+ ->label ( __ ( ' filament-latex::filament-latex.column.collaborators ' ) )
162
162
->options (fn () => $ userModel ::all ()->pluck ('name ' , 'id ' ))
163
- // ->query(fn (Builder $query, $data): Builder => dd($data))
164
- ->preload (),
163
+ ->query (function ($ query , $ data ) {
164
+ if (! empty ($ data )) {
165
+ // Apply the filter for JSON column
166
+ foreach ($ data as $ id ) {
167
+ $ query ->whereJsonContains ('collaborators_id ' , $ id );
168
+ }
169
+ }
170
+ })
171
+ ->multiple ()
172
+ ->native (false ),
165
173
])
166
174
->actions ([
167
175
Tables \Actions \ActionGroup::make ([
You can’t perform that action at this time.
0 commit comments