Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Alex360hd's avatar

Laravel 5.3+, JSON column with SQLite

Hello,

I red that since laravel 5.3, you can work with JSON columns.

I wonder if it works with SQLite with the JSON1 extension that normally bring JSON stuff to SQLite.

My objective is to make some database database where statements on json values like that :

->where('meta->favorite_color', 'red')

but on a SQLite database with JSON1 extension enabled.

Will it works ?

0 likes
5 replies
Alex360hd's avatar

Any update for that question ? It will be quite complex to me to install JSON1 extension (need to update whole ubunto to support good sqlite version etc...) so I need an answer before trying to install it.

Alex360hd's avatar

Thanks for the answer, your initiative is really great. I'm in a SQLite environment and being able to use JSON columns would be a huge plus !

patrikw1's avatar

Guys, any update on this? i just installated https://github.com/spatie/laravel-tags and i use :memory: storage inside my tests suite,

however, laravel-tags does use where condition like this: where('name->en', 'name') to query json column, and yea, i get null back since it doesnt work

i tried to install sqlite3 with version of 3.22 but cant get JSON1 extension to work :(

eduphp8's avatar

@patrikw1 it works for a while now whereJsonContains('name->en', 'name')no support for sqlite unfortunatelly

Please or to participate in this conversation.