Sep 2, 2018 by Thibault Debatty | 6488 views
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:
Modify your .env :
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.
Finally, create the database file:
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.