mehdi-fathi / eloquent-filter

Eloquent Filter is a package for filter data of models by the query strings. Easy to use and fully dynamic.
https://mehdi-fathi.github.io/eloquent-filter/
MIT License
430 stars 43 forks source link

Where Between clause doesn't work with relations #171

Closed JordanR-Surge closed 3 years ago

JordanR-Surge commented 3 years ago

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

mehdi-fathi commented 3 years ago

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