Laravel starter kit
Set up the Laravel starter kit locally, review the default configuration, and start building with sensible defaults in minutes.
Getting started
If you are already comfortable with Laravel, you can skim this section. Otherwise, follow the steps below to get the starter kit running locally.
First, extract the zip file, open the project folder in your terminal, and install the dependencies:
After the installation is complete, copy the example environment file and generate an application key:
Database setup
By default, this starter kit uses SQLite, so it works out of the box without any extra configuration.
If you prefer Postgres, update your .env file and set the appropriate values:
Replace your_database, DB_USERNAME, and DB_PASSWORD with your PostgreSQL credentials.
Then run the database migrations:
This project ships with roles and a user list. To quickly get an admin account and example users, run:
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:
Email verification
Laravel ships with built in email verification. To enable it in this starter kit, you need to do two things.
First, mark your User model as MustVerifyEmail:
Second, configure a mailer. For local development, you can use Mailpit. Install it on your machine, then add this to your .env file:
Some of these values are null on purpose because Mailpit does not require authentication.
Run mailpit
Once your configuration is ready, start Mailpit from your terminal:
If everything is set up correctly, you should see output similar to this:
Then open your browser and visit http://localhost:8025/ to access the Mailpit web interface and 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.
By default, after logging in, the project uses the sidebar layout.
Here is an example of how the dashboard page uses the sidebar layout:
To use the stack layout instead, simply change the layout import from sidebar-layout to stack-layout:
After that, the dashboard page will use the stack layout.
For consistency, you may also want to update the other authenticated pages to use the same layout. The easiest way is to search and replace sidebar-layout with stack-layout inside the pages directory. This will update all pages to use the stack layout automatically.
Quick login
To quickly test different users, you can visit a URL like 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.