-
Clone the project
[email protected]:NikitaSomik/simple-laravel-api.git
-
####Run through docker-compose in root directory project simple-laravel-api
-
Copy .env.example to .env
cp .env.example .env
-
Copy .env.testing.example to ..env.testing
cp .env.example .env
-
Download composer docker image to install dependencies.
docker run --rm --interactive --tty -v $(pwd):/app composer install
-
Configure a shell alias that allows you to execute Sail's commands more easily
alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'
-
Build and run project with sail in daemon mode
sail up -d --build
-
Generate app key
sail exec -it laravel.test php artisan key:generate
-
Create symlinks for storage
sail exec -it laravel.test php artisan storage:link
-
Run migrations and seeds
sail exec -it laravel.test php artisan migrate --seed
-
Run laravel-worker by supervisorctl
sail exec -it laravel.test supervisorctl start laravel-worker
-
API Documentation
http://localhost/docs/api#/
-
Web UI Supervisor
http://localhost:9001
-
Health App
http://localhost/up
-
Generate IDE Helper File
sail exec -it laravel.test php artisan ide-helper:generate
- PHPDoc generation for Laravel Facadessail exec -it laravel.test php artisan ide-helper:models -M
- PHPDocs for modelssail exec -it laravel.test php artisan ide-helper:meta
- PhpStorm Meta filesail exec -it laravel.test php artisan ide-helper:eloquent
- Adds Eloquent, Database\Eloquent\Builder, and Database\Query\Builder to the base model class. This is done right in the vendor directory. This gives a hint to the models that they have all the query builder methods. It is very convenient if you use scope functions.
-
Run tests
sail exec -it laravel.test php artisan test
-
Run Larastan (PHPStan)
sail exec -it laravel.test composer phpstan
-
Run Laravel Pint
sail exec -it laravel.test ./vendor/bin/pint