Sep 2, 2018 by Thibault Debatty | 17584 views
https://cylab.be/blog/1/using-laravel-with-a-sqlite-database
For a development environment or for small web applications, a SQLite database may be perfectly sufficient to store your data. It is also much lighter than a full blown MySQL database.
To use a SQLite database in your Laravel project:
DB_CONNECTION=sqlite
connections => sqlite
'database' => __DIR__ . '/../storage/app/db.sqlite',
I always recommend to put your SQLite database in the storage directory, as this directory should be the only one where your web server will have write permission.
touch storage/app/db.sqlite
You might come across an error message stating SQLite : unable to open database
The error message unable to open database can actually be misleading. To insert data in a database (/path/to/db.sqlite for example), SQLite requires that:
Hence one possible solution may be to check whether the directory containing your SQLite database is writable.
This blog post is licensed under CC BY-SA 4.0