Skip to content

Instantly share code, notes, and snippets.

Last active July 2, 2023 15:37
Show Gist options
  • Save bhaidar/f9d10004e64d53c7cc5fc79e3f938d72 to your computer and use it in GitHub Desktop.
Save bhaidar/f9d10004e64d53c7cc5fc79e3f938d72 to your computer and use it in GitHub Desktop.
Setting up a new Laravel application
## Setting up a Laravel application
I started by creating a new Laravel app. There are several methods for creating a new Laravel app. I chose the Docker-based one using the Laravel Sail package. You can read more about Laravel installation by following this URL (
Choose the method that best suits you. Before you start, make sure you have Docker running on your computer.
I'm using a MacBook Pro. I start by running this command:
curl -s "" | bash
This creates a new Laravel application on your computer under the directory named **laravel-app**.
After the installer finishes, run the following commands:
1. Open the .env file and add the following environment variables:
2. Build up the Docker container.
./vendor/bin/sail up
3. Install the NPM packages.
./vendor/bin/sail npm install
4. Serve the application.
./vendor/bin/sail run dev
The application is now accessible at http://localhost:1012. Open the URL in the browser, and you'll see the same view as in the figure below.
<img width="1240" alt="Figure4" src="">
Next, let's install the Laravel Breeze starter kit. The Laravel team provides this starter kit for scaffolding Laravel authentication and Profile management. This is my ultimate choice when starting a new Laravel project. Trust me: It saves you a lot of time! You can read more about Laravel Breeze here (
## Laravel Breeze Installation
Laravel Breeze comes in four flavors:
- Breeze & Blade
- Breeze & React
- Breeze & Vue
- Breeze & Next.js/API
I'll use Breeze and Vue here. The same installation method applies to the rest of Breeze flavours.
Run the following commands to install Laravel Breeze, VueJS, and InertiaJS together.
./vendor/bin/sail composer require \laravel/breeze --dev
./vendor/bin/sail artisan breeze:install vue
./vendor/bin/sail artisan migrate
./vendor/bin/sail npm install
./vendor/bin/sail npm run dev
By installing Laravel Breeze, you've installed a ton of new things in your application. Let me list them briefly, but you can always check this repository commit titled (install Laravel Breeze package) to check every new file and configuration added by the package.
In addition to the Breeze Starter Kit, Laravel also offers the JetStream Starter Kit, which is a more advanced option.
More importantly, Laravel Breeze does the following:
- Adds Vue, InertiaJS, and Tailwindcss
- Configures InertiaJS
- Configures Tailwindcss
- Scaffolds a front-end application using Vue/InertiaJS
- Adds Laravel Authentication controllers, views, and routes.
That's it!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment