File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 15
15
use Filament \Support \Contracts \TranslatableContentDriver ;
16
16
use Filament \Tables \Actions \Action ;
17
17
use Filament \Tables \Actions \BulkAction ;
18
+ use Filament \Tables \Actions \BulkActionGroup ;
18
19
use Filament \Tables \Columns \Column ;
19
20
use Filament \Tables \Contracts \HasTable ;
20
21
use Filament \Tables \Filters \BaseFilter ;
@@ -163,7 +164,14 @@ public function makeFilamentTranslatableContentDriver(): ?TranslatableContentDri
163
164
// ->all();
164
165
165
166
$ bulkActions = collect ($ table ->getBulkActions ()) // Bulk actions
166
- ->map (fn (BulkAction $ action ) => $ this ->mapTableAction ($ action ))
167
+ ->flatMap (function ($ action ) {
168
+ if ($ action instanceof BulkActionGroup) {
169
+ return collect ($ action ->getActions ())
170
+ ->map (fn (BulkAction $ childAction ) => $ this ->mapTableAction ($ childAction ));
171
+ }
172
+
173
+ return [$ this ->mapTableAction ($ action )];
174
+ })
167
175
->all ();
168
176
169
177
return [
Original file line number Diff line number Diff line change 5
5
use Filament \Resources \Pages \Page ;
6
6
use Filament \Support \Contracts \TranslatableContentDriver ;
7
7
use Filament \Tables \Actions \BulkAction ;
8
+ use Filament \Tables \Actions \BulkActionGroup ;
8
9
use Filament \Tables \Contracts \HasTable ;
9
10
use Illuminate \Support \Facades \Log ;
10
11
use Kirschbaum \Loop \Concerns \Makeable ;
@@ -54,7 +55,14 @@ public function makeFilamentTranslatableContentDriver(): ?TranslatableContentDri
54
55
$ records = $ resource ::getModel ()::find ($ recordIds );
55
56
$ actions = $ table ->getBulkActions ();
56
57
57
- $ targetAction = collect ($ actions )
58
+ $ flattenedActions = collect ($ actions )->flatMap (function ($ actionObj ) {
59
+ if ($ actionObj instanceof BulkActionGroup) {
60
+ return $ actionObj ->getActions ();
61
+ }
62
+ return [$ actionObj ];
63
+ });
64
+
65
+ $ targetAction = $ flattenedActions
58
66
->first (fn (BulkAction $ actionObj ) => $ actionObj ->getName () === $ action );
59
67
60
68
if (! $ targetAction ) {
You can’t perform that action at this time.
0 commit comments