How do I specify a sqlite database within .env or phpunit.xml? I wanna be able to use a different database, but I don't know how to mimic the storage_path() function within those files.
Also, I'd like to avoid editing the database.php file, where it says env('DB_DATABASE', storage_path('database.sqlite')).
Why do you want to avoid editing your database.php config file? Just modify it to look for an environment var.
'database' => storage_path(env('DB_NAME', 'database.sqlite'))
Then, in your phpunit.xml file (if you wish):
<env name="DB_NAME" value="testing.sqlite" />
I remember watching a video here on the site where Jeffrey specified a different DB for testing in his env.testing file which gets picked up when the tests are run. It should be similar for Laravel 5
It's not similar for L5, as the framework, by default, won't look for a env.testing file. You'd have to wire that up yourself.
@JeffreyWay It's because I'm using Lumen, and I don't really want to edit what's inside the vendor folder =/
Please sign in or create an account to participate in this conversation.