Laravel 8 has multiple ways of installation. Let’s discuss the process when working on a Mac or Linux Operating System. Let us go through some guidelines that will help you install Laravel 8 on Mac.
If you’re developing Laravel project on a Mac, you should have already installed the Docker Desktop. You may then open your terminal and type following commands as shown below to install Laravel 8 on Mac. This will create a new Laravel 8 project for you.
# if you want to name your project differently
# change laravel8-app to something else
curl -s "https://laravel.build/laravel8-app" | bash
Once above command runs successfully you will see output like the following image.
Run Laravel 8 app
Your newly installed Laravel 8 project and docker are now able to run your Laravel 8 project inside docker environment. After you create your project, you may navigate to your application directory and start using Laravel Sail.
Laravel Sail is a simple command-line interface that allows interaction with Laravel’s default Docker configuration. To use it, you can open your terminal window (from Laravel Project root directory) and run the following commands as shown below.
# go to your new laravel project directory
cd laravel8-app
# run following command to run your app in background
./vendor/bin/sail up -d
When the docker images are pulled and containers are running you will see a similar output on your console as shown below.
You may now go to your browser and type your localhost url: http://localhost to see your app running.