Require
PHP 8.1 or later
MySQL 8.0 or later
Setup
- Composer install dependencies
If use native environment:
composer install
If use docker environment:
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer install --ignore-platform-reqs
-
Create database
-
Copy
.env.example
to.env
cp .env.example .env
- Update database connection and redis connection on
.env
If you use Docker, set
DATABASE_HOST=mysql
andREDIS_HOST=redis
.
In this step, you can update another configuration in dotenv file.
- Setup Docker service first time (only Docker)
./vendor/bin/sail up -d
TIP: you can set
sail
is alias of./vendor/bin/sail
in~/.zshrc
or~/.bash_profile
.
- Run database migrations and database seeding.
# on native environment
php artisan migrate
- Run build file css and js
npm install
npm run dev