Prerequisites
- Docker
- Linux suggested but not required. Volume mounts on WSL are extremely slow and cause high load times
Notes on Local Development
- The renderer is an external service. All requests to the Renderer helper class will be ignored in local.
Setup
- Login to Gitlab registry
docker login registry.gitlab.com
Username is Gitlab username, password being a personal access token from settings
- Rename .env.example to .env
- Modify
APP_URLandSESSION_DOMAINto the domain you wish to use. Tests usehttp://laravel-site.test - Overwrite DNS to point your local computer to that domain. Linux is located at
/etc/hostsmacOS at/private/etc/hostsand Windows atC:\Windows\System32\Drivers\etc\hosts.127.0.0.1 laravel-site.test 127.0.0.1 api.laravel-site.test 127.0.0.1 admin.laravel-site.test
- Run setup commands
docker-compose run webpack npm install docker-compose run composer composer install docker-compose run app php artisan key:generate docker-compose run app php artisan migrate:fresh --seed
- Site can be started with
docker-compose up -d. Note that this will keep it always running and you will have to rundocker-compose downto turn it off.- Optional services like the queue worker and scheduler can be started with
docker-compose --profile all-services up -d
- Optional services like the queue worker and scheduler can be started with
- Default username and password are
Test Namepassword
Development Tools
Anyone not using VSCode is invalid.
Suggested extensions
Code completion suggestions for Intelephense can be written using
docker-compose run app php artisan ide-helper:model -M docker-compose run app php artisan ide-helper:generate
Running Tests
Laravel tests are run with docker-compose run app php artisan test
PHPStan tests are run with docker-compose run app ./vendor/bin/phpstan analyse --memory-limit=2G