Reference

Laravel Reference

Configuration

config/app.php

Make sure to change the time zone:

'timezone' => 'America/Los_Angeles',

.env

For local development, enter your database credentials:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=databasename
DB_USERNAME=databaseuser
DB_PASSWORD=password

To use MailTrap.io for sending emails to a test email Inbox, get a MailTrap account, then add this info to .env:

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=mailtrapusername
MAIL_PASSWORD=mailtrappassword
MAIL_ENCRYPTION=null

To use MailGun for sending emails to real Inboxes, get a Mailgun account, then add this info to .env:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=2525
MAIL_USERNAME=mailgunusername
MAIL_PASSWORD=mailgunpassword
MAIL_ENCRYPTION=null

MAILGUN_DOMAIN=mg.domain.tld
MAILGUN_SECRET=mailgunsecretkey

To set a default "FROM" email address for all outbound emails, add these lines:

MAIL_FROM_ADDRESS=valid-email@domain.tld
MAIL_FROM_NAME='Display Name'

NOTE: Some email systems will reject or bounce your emails if you don't use a valid "FROM" email address.

AppServiceProvider

If you're using MySQL < 5.7.7, avoid getting "Specified key was too long" errors by adding this at the top:

use Illuminate\Support\Facades\Schema;

Then add this to the boot() method:

Schema::defaultStringLength(191);