Set up postgres database in Laravel env file
Suppose you are launching a Postgres database using dbngin.
By default the username of connecting to the database in postgres
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=DATABASEDCUSTOMNAME
DB_USERNAME=postgres // the default user after installation by dbngin
DB_PASSWORD=
If the connection is mysql
and you choose this database name DATABASEDCUSTOMNAME
even if it is not already created in the database, php artisan migrate
will create that database by asking your permission.
But for PostgresSql it won't create automatically and you have to already create it in the database and then use php artisan migrate
.
Sqlite
For sqlite you should comment all the keys and follow the official document. https://laravel.com/docs/10.x/database#sqlite-configuration
DB_CONNECTION=sqlite
#DB_HOST=127.0.0.1
# DB_PORT=5432
# DB_DATABASE=DATABASEDCUSTOMNAME
# DB_USERNAME=postgres // the default user after installation by dbngin
# DB_PASSWORD=