File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -114,4 +114,11 @@ public function search_filter_alt_query_relation()
114
114
$ this ->tableAltQuery ->filters ['search ' ] = 'Cat ' ;
115
115
$ this ->assertEquals (2 , $ this ->tableAltQuery ->rows ->total ());
116
116
}
117
+
118
+ /** @test */
119
+ public function bulk_actions_defined_with_function ()
120
+ {
121
+ $ this ->table ->selected [] = 1 ;
122
+ $ this ->assertEquals (1 , $ this ->table ->count ());
123
+ }
117
124
}
Original file line number Diff line number Diff line change 9
9
10
10
class PetsTable extends DataTableComponent
11
11
{
12
+ public function bulkActions (): array
13
+ {
14
+ return [ 'count ' => 'Count selected ' ];
15
+ }
16
+
12
17
/**
13
18
* @return Builder
14
19
*/
@@ -36,4 +41,9 @@ public function columns(): array
36
41
->searchable (),
37
42
];
38
43
}
44
+
45
+ public function count (): int
46
+ {
47
+ return $ this ->selectedRowsQuery ()->count ();
48
+ }
39
49
}
You can’t perform that action at this time.
0 commit comments