mehdi-fathi/eloquent-filter

Where Between clause doesn't work with relations

JordanR-Surge opened this issue · 1 comments

Describe the bug
I need to do a where between on a relation but it seems to break down when using the start and end parameters.

To Reproduce
Query: Users::select('users.name')->join('posts', 'posts.user_id', '=', 'users.id')->filter(['posts' => [ 'created_at' => [ 'start' => '2021/01/21', 'end' => '2021/01/23' ] ]])->get();

Error:
You must set posts.updated_at.start in whiteListFilter in Users.php

Expected behavior
It should create a whereBetween using the posts updated_at

@JordanR-Surge Thanks for the report. It's been fixed in the 2.5.3 version.