TitasGailius / nova-search-relations

This package allow you to include relationship columns into Laravel Nova search query.
Other
353 stars 33 forks source link

Allows searching of multiple parts #18

Closed CraigHarley closed 4 years ago

CraigHarley commented 5 years ago

With this, you can now do a search like:

'MAN,1002,Beep'

To search all the fields for an 'MAN', 1002, and 'Beep'.

Made the search left to right only (this means that SQL can use the indexes properly).

I took out the postgres stuff because we don't need it in the project I'm using it on, and it's a little messy and there's probably a better way to this. But thought I'd contribute the solution I came up with, feel free to fix it up to your liking and merge it in, or not :).

TitasGailius commented 4 years ago

I finally got some time to check this. I want the relationship search to behave exactly the same how Nova is behaving with regular search. This PR breaks this consistency.

If you want to adjust the behaviour to your needs, overriding this method is not of a big deal.