Illuminate\Database\QueryException with message 'SQLSTATE[42000]: [Microsoft][ODBC Driver17 for SQL Server] [SQL Server]'json_value' is not a recognized built-in function name.
gsferro opened this issue · comments
My setup:
PHP 8.0.9
LARAVEL 8.*
SQL SERVER 2019
Use by Tinker
Psy Shell v0.10.12 (PHP 8.0.9 — cli) by Justin Hileman
>>> use Spatie\Tags\Tag
>>> Tag::create(['name' => '30 CM', 'type' => 'Largura'])
=> Spatie\Tags\Tag {#3981
name: "{"pt-br":"30 CM"}",
type: "Largura",
slug: "{"pt-br":"30-cm"}",
order_column: 1,
updated_at: "2022-01-20 23:00:15.140",
created_at: "2022-01-20 23:00:15.140",
id: 1,
}
>>> Tag::create(['name' => '30 CM', 'type' => 'Comprimento'])
=> Spatie\Tags\Tag {#3979
name: "{"pt-br":"30 CM"}",
type: "Comprimento",
slug: "{"pt-br":"30-cm"}",
order_column: 2,
updated_at: "2022-01-20 23:00:22.141",
created_at: "2022-01-20 23:00:22.141",
id: 2,
}
>>> Tag::containing('30')->get()
Illuminate\Database\QueryException with message 'SQLSTATE[42000]: [Microsoft][ODBC Driver17 for SQL Server]
[SQL Server]'json_value' is not a recognized built-in function name.
(SQL: select * from [tags] where lower(json_value([name], '$."pt-br"')) like %30%)'