Test custom filter

Hi, i have made a custom FromDate to ToDate custom selectDate filter into the table, how do i test the custom filter
3 Replies
Dennis Koch
Dennis Koch2y ago
That doesn't really explain testing, does it? @drkrvltnry where are you stuck? I think it should work the same way as testing a single filter? Just pass an array instead of a single value
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
BATMAN
BATMANOP2y ago
I think i've solved it, since i have this following custom filter form added to the filter table,
$this->form([
Grid::make(2)->schema([
DateTimePicker::make('from')
->label($fromLabel),
DateTimePicker::make('to')
->disabled()
->label($toLabel),
]),

]);
$this->form([
Grid::make(2)->schema([
DateTimePicker::make('from')
->label($fromLabel),
DateTimePicker::make('to')
->disabled()
->label($toLabel),
]),

]);
in my testing case, i just added array to the
->filterTable("date_time", [
'from' => $alert->first()->date_time,
'to' => $alert->first()->date_to
])
->filterTable("date_time", [
'from' => $alert->first()->date_time,
'to' => $alert->first()->date_to
])
thanks a lot
Want results from more Discord servers?
Add your server