Custom filter forms (From - Until Filter)
i am creating a filter for checking the data from the selected date to until selected date.
And in documentation we have The custom filter It's cool.
but I have another condition the date I want to filter is coming from another relation.
OK my current resource name is Transaction.
so I have a relation named payment and I am showing it's one field in transaction resource named payment_date
so i can make a filter using documentation for transaction created_at column.
like that
but i have a relation named payment and i want to filter its field payment_date in Transaction resource
BTW i used this code
so how can i do that?
THANKS IN ADVANCE.
3 Replies
because it's a relation i think you can use
whereRelation()
method
https://laravel.com/docs/10.x/eloquent-relationships#inline-relationship-existence-queriesok thank you i will check it/
Thanks @krekas Its working
I used this code
Solution
π