- Clone this repository.
- Enter into project directory (
cd laravel-demo) and run:
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/opt \
-w /opt \
laravelsail/php84-composer:latest \
composer install --ignore-platform-reqs
This will fetch the packages dependencies without the need of having PHP and Composer installed in the host machine.
- Create
.envfile copying it from.env.example. - Set database default parameters in
.envfile:DB_CONNECTION=mariadb DB_HOST=mariadb DB_PORT=3306 DB_DATABASE=demo DB_USERNAME=sail DB_PASSWORD=password - Run
php artisan key:generateto create an application key in.envfile. - Start the Laravel application with
./vendor/bin/sail up. If you want the Docker console output to be dettached, use./vendor/bin/sail up -d. - The web application will be available in http://localhost or http://127.0.0.1. Optionally, you can create a custom local domain in your
hostsfile, for examplelaravel.demo; and set it in the.envfile too. - Run the migrations to create the default database tables and sample data:
php artisan migrate. - The application can be stopped with
./vendor/bin/sail stop. - Optionally, you can create a desktop alias to start and stop the application:
laravel-demo='cd /path/to/laravel-demo && ./vendor/bin/sail'.
Read the Laravel Documentation as much as you need it.