Laravel starter kit

Install the Laravel starter kit, configure the database and mail, and choose a page layout.

Getting started

Extract the starter kit zip file, open the project folder in your terminal, and install the dependencies:

Terminal

Copy the example environment file and generate an application key:

Terminal

Database setup

The starter kit uses SQLite by default.

To use PostgreSQL, update .env with your connection details:

.env

Replace your_database, DB_USERNAME, and DB_PASSWORD with your PostgreSQL credentials.

Then run the database migrations:

Terminal

To create an administrator account and example users, run:

Terminal

The command will ask for your name, email, and password for the administrator account, then create 50 example users.

Serving the application

If you are using Herd, you can open the app by visiting your-project.test in your browser.

If you are using the built-in Laravel development server, run:

Terminal

Email verification

To enable email verification, update the User model and configure a mailer.

Implement MustVerifyEmail on the User model:

app/Models/User.php

For local email testing, use Mailpit. Install it on your machine, then add this to your .env file:

.env

Mailpit does not require authentication, so the username and password are null.

Run Mailpit

Start Mailpit:

Terminal

Mailpit displays the SMTP and web interface addresses:

Terminal

Open http://localhost:8025/ to inspect outgoing emails.

Layout

This project includes three layouts: one for guest pages and two for authenticated pages.

For authenticated pages, you can choose between sidebar-layout and stack-layout. The stack-layout uses a navbar, while the sidebar-layout uses a sidebar.

Authenticated pages use the sidebar layout by default.

The dashboard page assigns its layout as follows:

To use the stack layout, change the import:

To use the stack layout across authenticated pages, replace the sidebar-layout imports in those pages with stack-layout.

Quick login

To sign in as a test user, visit http://localhost:8000/dev/login/5 to log in as the user with ID 5. Change the number at the end of the URL to log in as another user.

This feature is only available in the local environment. If you want to remove it, delete the routes/dev.php file and remove its require entry from routes/web.php.