Open ishan-biztech opened 4 years ago
An alternative is to update the config modes on the fly, this way you only disable the modes needed to run your query
config()->set('database.connections.mysql.modes', [ // 'ONLY_FULL_GROUP_BY', 'STRICT_TRANS_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'ERROR_FOR_DIVISION_BY_ZERO', 'NO_AUTO_CREATE_USER', 'NO_ENGINE_SUBSTITUTION' ]);
And then enable all modes again afterwards:
config()->set('database.connections.mysql.modes', null);
However this feels like a temporary fix that should not be needed.
From https://github.com/nicolaslopezj/searchable/issues/206#issuecomment-787066436
It's working for me in laravel 8. I just had to : In config/database.php, set mysql's 'strict' to false.
Originally posted by @kevintresuelo in https://github.com/nicolaslopezj/searchable/issues/206#issuecomment-737838085