- PHP 8.2
- Composer ^2.4
- Docker
- Ctype PHP Extension
- cURL PHP Extension
- DOM PHP Extension
- Fileinfo PHP Extension
- Filter PHP Extension
- Hash PHP Extension
- Mbstring PHP Extension
- OpenSSL PHP Extension
- PCRE PHP Extension
- PDO PHP Extension
- Session PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
- Redis PHP Extension
- PDO_Postgres PHP Extension
- PDO_Mysql PHP Extension (optional)
- GD PHP Extension (optional)
- Imagick PHP Extension (optional)
Run script below for quick setup
sh ./setup.sh -p 3000 -a -f -d -r 6380 -b 5433 -e local
Option | Description | Value |
---|---|---|
-p |
Specify custom app port. Default is 3000 | Number |
-a |
Specify has authentication module | Empty |
-f |
Specify has file upload feature | Empty |
-d |
Specify docker is development environment if local machine don't install PHP and Composer | Empty |
-r |
Specify custom redis port. Default is 6379 | Number |
-b |
Specify custom database port. Default is 5432 | Number |
-e |
Specify custom environment (local ,development ,staging ,production ). Default is local |
string |
Note: Please make sure that the file .env.staging and .env.production are exist (check the encrypt/decrypt ) before run the script above
1./ Install Package
Select one of methods belows:
With composer
composer install
Without composer
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html" \
-w /var/www/html \
laravelsail/php82-composer:latest \
composer install --ignore-platform-reqs
2./ Copy .env
cp .env.development .env
2.1/ (Optional) Modify .env on 1st run at local environment
APP_ENV=local
3./ Start app
./vendor/bin/sail up -d
4./ Generate app key
./vendor/bin/sail php artisan key:generate --ansi
5./ Run migration
./vendor/bin/sail php artisan migrate
6./ (Optional) Create symlink for file storage if you're using local disk upload
./vendor/bin/sail php artisan storage:link
7./ (Optional) Generate Passport secret if you're using authentication modules (EMAIL LOGIN, SMS LOGIN...)
./vendor/bin/sail php artisan passport:keys
./vendor/bin/sail php artisan passport:client --password
Note*: If you have multiple-authentication models, and when passport asking for provider, just pick the 1st option. It doesn't matter.
Copy your new client_id, client_secret to FE project
- In order to decrypt env, please get the key from {your_env_name}.key file and run command below
./vendor/bin/sail php artisan env:decrypt --env=your_env_name --key=your_key
or
php artisan env:decrypt --env=your_env_name --key=your_key
EX: In order to decrypt staging env, get the key from file staging.key
and run command below
./vendor/bin/sail php artisan env:decrypt --env=staging --key=1234567890
- In order to encrypt env, please get the key from {your_env_name}.key file and run command below
./vendor/bin/sail php artisan env:encrypt --env=your_env_name --key=your_key
or
php artisan env:encrypt --env=your_env_name --key=your_key
EX: In order to decrypt staging env, get the key from file staging.key
and run command below
./vendor/bin/sail php artisan env:encrypt --env=staging --key=1234567890
View in the browser on (replace the 3000 with your port)
http://localhost:3000/api/health-check/
View in the browser on (replace the 3000 with your port)
http://localhost:3000/request-docs/
- To using localization, attach the locale name in
Accept-Language
header in every request. Supporting locales areen
(English) andja
(Japanese)
- Currently, the APIs have Rate Limit at 60 requests/min, calculating by IP (Anonymous) and by ID (Authenticated User)
- Official Docs https://laravel.com/docs/10.x/routing#rate-limiting
- Rollbar Token is set at key
ROLLBAR_TOKEN
, with level log asdebug
. - Will be conditional load for each env that input on the Studio. Implement at
app/Providers/AppServiceProvider.php
- Logging config at
config/logging.php
- Validate Project Key
- Via artisan (sail)
./vendor/bin/sail php artisan rollbar:validate-key
- or via composer (sail)
./vendor/bin/sail composer additional-commands
- Via artisan (sail)
- For more details please check the Official Docs https://docs.rollbar.com/docs/laravel
- SCOUT KEY is set at key
SCOUT_KEY
, with level log asinfo
. You could change it by addingSCOUT_LOG_LEVEL
to your env. Check official docs for more details https://scoutapm.com/docs/php/configuration - Will be conditional load for each env that input on the Studio. Implement at
app/Providers/AppServiceProvider.php
- More config could be done by publishing Scout config:
php artisan vendor:publish --provider="Scoutapm\Laravel\Providers\ScoutApmServiceProvider"
- For more details please check the Official Docs https://scoutapm.com/docs/php/laravel