File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ public function resetBulk(): void
68
68
*/
69
69
public function selectedRowsQuery ()
70
70
{
71
- return $ this ->query ()->unless (
72
- $ this ->selectAll ,
71
+ return $ this ->query ()->when ( $ this -> selectAll ,
72
+ fn ( $ query ) => $ this ->applySearchFilter ( $ query ) ,
73
73
fn ($ query ) => $ query ->whereIn ($ query ->qualifyColumn ($ this ->primaryKey ), $ this ->selected )
74
74
);
75
75
}
Original file line number Diff line number Diff line change @@ -161,4 +161,16 @@ public function bulk_actions_defined_through_function()
161
161
$ this ->table ->selected [] = 1 ;
162
162
$ this ->assertEquals (1 , $ this ->table ->count ());
163
163
}
164
+
165
+ /** @test */
166
+ public function bulk_actions_defined_through_with_select_all_function ()
167
+ {
168
+ $ this ->assertArrayHasKey ('count ' , $ this ->table ->bulkActions );
169
+
170
+ $ this ->table ->resetFilters ();
171
+ $ this ->table ->filters ['search ' ] = 'Chico ' ;
172
+ $ this ->assertEquals (1 , $ this ->table ->getRowsProperty ()->total ());
173
+ $ this ->table ->selectAll ();
174
+ $ this ->assertEquals (1 , $ this ->table ->count ());
175
+ }
164
176
}
You can’t perform that action at this time.
0 commit comments