This project support Docker environment by Laravel Sail. If you're using Laravel Valet, it's ok.
- 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
php artisan db:seed
# on Docker environment
./vendor/bin/sail php artisan migrate
./vendor/bin/sail php artisan db:seed
- Create
public_access_api_tokens
using command:
# on native environment
php artisan api:public-access-token-create
# on Docker environment
./vendor/bin/sail php artisan api:public-access-token-create
- Front-end development
Just run npm install
and npm run watch
when to edit some javascript files and sass files.