Custom datetime filter within relation
I am building a table for an Alert model, whose timestamp is found through a 'timestamp' column from a related model (event), and I'm trying to get a filter on that, like this:
However, I get an error pointing 'time_from' and 'time_until' indexes do not exist in $data, which seems correct since $data is completely empty.
What I'm missing in between? Why is $data empty?
Solution:Jump to solution
Okey, I just solved it easily by using whereHas on QueryBuilder
```php
Filter::make('timestamp')
->form([
DateTimePicker::make('time_from')...
1 Reply
Solution
Okey, I just solved it easily by using whereHas on QueryBuilder
Although I feel like there should be (or there actually is) a better way to do this