Laravel Version
10.34.2
PHP Version
8.2.3
Database Driver & Version
3.39
Description
When testing I am using sqlite.
When now trying to use the "whenJsonContains" method or any derived method, it throws the error message:
"This database engine does not support JSON contains operations."
In the docs on the other hand you can find this example:
$users = DB::table('users') ->whereJsonContains('options->languages', 'en') ->get();
Right above you can find this text: "You may use whereJsonContains to query JSON arrays. This feature is not supported by SQLite database versions less than 3.38.0:"
SQLite still has no "json_contains" method. Another approach would be to use the json_each method as follows:
SELECT {table}.* from {table}, json_each({table}.{column}, {path}) as {table}{column}Each WHERE {table}{column}Each.value = {value};
It would still have the same restriction, that you can only search for a non array value but it should work
Steps To Reproduce
https://github.com/laravel/framework/blob/10.x/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php