vendredi 1 juin 2018

"Database does not exist" - Set path to SQLITE database for API route in Laravel

In my Laravel (5.4) project I want to use sqlite. But when trying to access it I get an "Database does not exist" error.

In my .env file I use

DB_CONNECTION=sqlite
DB_DATABASE=database/easyresults.sqlite

I used touch database/easyresults.sqlite to create the db and successfully ran the migrations using php artisan migrate. But when accessing it using a XMLHTTPRequest, I get the error above.

After changing the path in the .env file to

DB_DATABASE=../database/easyresults.sqlite

I can acces it again, however any command line call doesn't work then.

What am I missing? Does it not work using the .env file? Do I have to use database_path('easyresults.sqlite') and put it directly into config/database.php?

Thanks a lot for your support.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2LO1vOM
via IFTTT

Aucun commentaire:

Enregistrer un commentaire