-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add support to MySQL for keyword LIKE, add support to laravel 5.4.* for relation keys and other minor fixes #20
Conversation
…instead of LIKE to make the match case insensitive according to the active locale. This is not in the SQL standard but is a PostgreSQL extension.
… or equal to) operators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. However, this will be bumped major version since it breaks 5.3 and below. Could you add a note to the readme file that 2.x and below is for Laravel 5.3 and 3.x and is for 5.4 and above?
src/EloquentBuilderTrait.php
Outdated
{ | ||
// $value, $not, $key, $operator | ||
extract($filter); | ||
|
||
$table = $query->getModel()->getTable(); | ||
$dbType = Config::get('database.default'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is the most optimal way to get the connection type. The database key can be any arbitrary value.
What about getting it from the queryBuilder, something like $queryBuilder->getConnection()->getDriverName()
. I just quickly looked it up, so I am not 100% sure it is a viable option - could you look into it? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked for it and it works perfectly :D nice!
Done! :D |
Thanks :-) |
The keyword ILIKE can be used instead of LIKE to make the match case insensitive according to the active locale. This is not in the SQL standard but is a PostgreSQL extension.