Database

Its easy to setup whatever database you want to use for your project.

You can choose between SQLite, MySQL and PostgreSQL.

SQLite

For setting up SQLite you need to do two simple steps:

  1. Run touch database/database.sqlite in the terminal
  2. Update DB_CONNECTION=sqlite in .env and delete the other database variables (all DB_ variables)

This works because Laravel uses the database/database.sqlite file by default. If you want to use a different file, you can update the DB_DATABASE variable in the .env file.

MySQL

First of all you need to create the new MySQL database:

  1. Run mysql -u root -p in the terminal
  2. Once logged into mysql, run CREATE DATABASE your_db_name;

Then you need to update the .env file with the following variables:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_db_name
DB_USERNAME=your_db_username
DB_PASSWORD=your_db_password

PostgreSQL

Create the new PostgreSQL database

  1. Run psql -u <your_db_username> in the terminal
  2. Once logged into psql, run CREATE DATABASE your_db_name;

After creating the DB update the .env file with the following variables:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=your_db_name
DB_USERNAME=your_db_username
DB_PASSWORD=your_db_password