laravel-query-builder icon indicating copy to clipboard operation
laravel-query-builder copied to clipboard

[FEAT] add filter by operator

Open AbdelrahmanBl opened this issue 1 year ago • 9 comments

Dear sir I had been developed out of the box a method for filtering by operator. for the example:

QueryBuilder::for(User::class)
->allowedFilters([
    AllowedFilter::operator('salary', FilterOperator::GREATER_THAN),
])
->get();

Note: I realized that there is some old test cases not working.

AbdelrahmanBl avatar May 15 '24 00:05 AbdelrahmanBl

@AbdelrahmanBl is it possible to pass the operator through query parameters?

siarheipashkevich avatar May 15 '24 09:05 siarheipashkevich

It's really a great idea! Now you can search by a dynamic filter operator. for the example:

// users?filter[salary]=>=1000,<=3000
QueryBuilder::for(User::class)
->allowedFilters([
    AllowedFilter::operator('salary', FilterOperator::DYNAMIC),
])
->get();

AbdelrahmanBl avatar May 15 '24 12:05 AbdelrahmanBl

@freekmurze

AbdelrahmanBl avatar May 20 '24 20:05 AbdelrahmanBl

Hello sir! How are you? Can you check this feature? @freekmurze

AbdelrahmanBl avatar Jun 01 '24 14:06 AbdelrahmanBl

Hello sir! How are you? Can you check this feature? @freekmurze

@AbdelrahmanBl Please stop deleting your previous comment and @ people. No doubt they're busy and they'll get to it when they get to it.

benswinburne avatar Jun 01 '24 23:06 benswinburne

Thank you for your response 🙏 and i won't contribute with spatie anymore for not annoying them.

AbdelrahmanBl avatar Jun 01 '24 23:06 AbdelrahmanBl

I'm not from Spatie, just someone whose inbox you were spamming. Repeatedly @ing anyone isn't productive be it Spatie or anyone else.

I'd subscribed to the thread because i'm interested in the feature as I'm sure others are too. Closing it because someone suggest you be patient seems overkill, but it is your PR to do what you will with.

benswinburne avatar Jun 02 '24 00:06 benswinburne

I thought you were from spatie and no problem i will reopen it to benefit the others 😊

AbdelrahmanBl avatar Jun 02 '24 00:06 AbdelrahmanBl

@freekmurze kindly check this commit!

AbdelrahmanBl avatar Jun 20 '24 03:06 AbdelrahmanBl

Hi @freekmurze,

This improvement could be considered to be released. I mean, it's a good feature, I don't understand why not implement the feature. Are there some pending considerations? Or Do you want to implement this feature in another way? It will be great to know it.

Thanks

cgarcia-lightit avatar Aug 30 '24 17:08 cgarcia-lightit

Could you update the readme with clear examples on how to use this?

freekmurze avatar Aug 31 '24 11:08 freekmurze

Hi @AbdelrahmanBl ,

Could you generate the requested documentation? We are close to get merge this pr 😄

cgarciagarcia avatar Aug 31 '24 20:08 cgarciagarcia

@cgarciagarcia Okay i will implement that as soon as possible

AbdelrahmanBl avatar Aug 31 '24 23:08 AbdelrahmanBl

Hello @AbdelrahmanBl , I would like to know if there are posibilities to include the documententation that freekmurze requested to merge this PR. I like your feature and I think it's a good resolution approach.

cgarciagarcia avatar Sep 22 '24 19:09 cgarciagarcia

Thanks everyone for your input and hard work! I'll add docs for this feature and tag it as a new feature release.

AlexVanderbist avatar Sep 27 '24 07:09 AlexVanderbist

@AbdelrahmanBl thank you

siarheipashkevich avatar Sep 27 '24 07:09 siarheipashkevich

thanks guys, i'm very busy nowadays and that is the reason for not completing the doc

AbdelrahmanBl avatar Sep 27 '24 09:09 AbdelrahmanBl

Thanks @AbdelrahmanBl for your work! and spatie team for your care.

cgarcia-lightit avatar Sep 27 '24 20:09 cgarcia-lightit