laravel-exa icon indicating copy to clipboard operation
laravel-exa copied to clipboard

Feat: Creating conditional for relationships filter

Open msoares94 opened this issue 9 months ago • 1 comments

With this PR, it will be possible to apply filters not only to the main table, but also to its relationships.

$query = Datatable::applyFilter($query, $datatableDTO, [
  'field_a', 'field_b', 'relationship.field_a', 'relationship.field_b'
]);
``

msoares94 avatar May 03 '24 03:05 msoares94

Now that I think about this, I think that this won't work with joins when you need to specify the table - using aliases or just because it has the same field in two different tables.

We need to test this further before merging it.

WendellAdriel avatar May 03 '24 14:05 WendellAdriel

This could potentially create issues with queries not using relationships.

WendellAdriel avatar May 28 '24 11:05 WendellAdriel