Closed ricardomartos closed 2 years ago
Please update the readme as well to reflect the addition of env variable
@kodeine I think is ready now ;)
If you are using this package with a secondary database connection, you can set the METADATA_DATABASE
variable in your .env
in order to let this package know the secondary connection database name.
CONNECTION 1
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=<NAME>
DB_USERNAME=<USERNAME>
DB_PASSWORD=<PASSWORD>
CONNECTION 2
DB_CONNECTION=mysql
DB_HOST=<SOME_OTHER_HOST>
DB_PORT=3306
DB_DATABASE=<NAME> <--
DB_USERNAME=<USERNAME>
DB_PASSWORD=<PASSWORD>
// TWO OPTIONS
METADATA_DATABASE=<NAME>
// OR
METADATA_DATABASE='${DB_DATABASE}'
This PR has two major problems:
env
outside of config
directory as explained in Laravel's documention
change connection name if env 'METADATA_DATABASE' is set