You only need to change the DB_CONNECTION variables to sqlite. Also don't forget to create the database.sqlite file in the storage directory!
SQLite Database Config not working for Artisan
I try to use Lumen with SQLite.
If I have this setup in my .env
DB_CONNECTION=sqlite DB_DATABASE='../storage/database.sqlite'
then, this is working: $results = User::all();
but, when I try to migrate via Artisan, I'll get:
"Database (../storage/database.sqlite) does not exists.
When I change my .env to:
DB_CONNECTION=sqlite DB_DATABASE='storage/database.sqlite'
then Artisan is working, but $results = User::all() give this error: Database (storage/database.sqlite) does not exist.
It seems that Artisan is looking for that SQLite Database from another folder?
I guess they changed the location then. You can find this in the source code of lumen-framework
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => env('DB_PREFIX', ''),
],
So you need to place the database.sqlite file in the database directory ;) That should fix it!
Lumen-framework: https://github.com/laravel/lumen-framework/blob/5.1/config/database.php#L54
Please or to participate in this conversation.