Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check number of parameters passed to where function #33

Open
michi-7 opened this issue Apr 18, 2022 · 0 comments
Open

Check number of parameters passed to where function #33

michi-7 opened this issue Apr 18, 2022 · 0 comments

Comments

@michi-7
Copy link

michi-7 commented Apr 18, 2022

Step to reproduce the problem: pass only 2 parameters to where method, the second one must be a string containing a valid SQL operator. Something like this:
$model->where('id', '<>');
This will make a query like this:
select * from table where id is not null
Where method should check the number of parameters passed and pack inside the $bag only the ones passed by the user, as eloquent already have default values for those how are missing, or skip the first check that verify if $operator is a valid SQL operator if there are only 2 parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant