| name | symfony:daily-workflow |
| description | Daily development workflow for Symfony projects including common tasks, debugging, and productivity tips |
Daily Symfony Development Workflow
Starting Your Day
1. Update Dependencies (if needed)
git pull origin main
composer install
bin/console doctrine:migrations:migrate --no-interaction
bin/console cache:clear
2. Start Services
docker compose up -d
docker compose up -d --wait
symfony server:start -d
3. Check Status
bin/console doctrine:query:sql "SELECT 1"
bin/console messenger:stats
bin/console cache:pool:list
Common Development Tasks
Creating New Features
bin/console make:entity Product
bin/console make:migration
bin/console doctrine:migrations:migrate
bin/console make:controller ProductController
bin/console make:form ProductType
bin/console make:test WebTestCase ProductControllerTest
Working with Doctrine
bin/console doctrine:schema:validate
bin/console doctrine:schema:update --dump-sql
bin/console make:migration
bin/console doctrine:fixtures:load
bin/console doctrine:database:drop --force
bin/console doctrine:database:create
bin/console doctrine:migrations:migrate --no-interaction
bin/console doctrine:fixtures:load --no-interaction
Working with Messenger
bin/console messenger:consume async -vv
bin/console messenger:consume async --limit=10 --time-limit=60
bin/console messenger:failed:show
bin/console messenger:failed:retry --all
bin/console messenger:stop-workers
Debugging
Debug Tools
bin/console debug:router
bin/console debug:router api_products_get_collection
bin/console debug:container
bin/console debug:container ProductService
bin/console debug:autowiring Product
bin/console debug:config framework
bin/console debug:config api_platform
bin/console debug:event-dispatcher
bin/console debug:event-dispatcher kernel.request
Profiler
bin/console profiler:list
Logging
tail -f var/log/dev.log
grep "ERROR" var/log/dev.log
grep "doctrine" var/log/dev.log
Dump and Die
dump($variable);
dd($variable);
{{ dump(variable) }}
Testing Workflow
Running Tests
./vendor/bin/phpunit
./vendor/bin/pest
./vendor/bin/pest tests/Functional/Api/ProductTest.php
./vendor/bin/pest --filter "creates product"
./vendor/bin/pest --coverage --min=80
./vendor/bin/pest --parallel
TDD Cycle
./vendor/bin/pest tests/Unit/Service/ProductServiceTest.php
./vendor/bin/pest tests/Unit/Service/ProductServiceTest.php
./vendor/bin/pest
Code Quality
Before Committing
./vendor/bin/php-cs-fixer fix
./vendor/bin/phpstan analyse
./vendor/bin/pest
composer run-script check
Pre-commit Hook
#!/bin/sh
./vendor/bin/php-cs-fixer fix --dry-run
if [ $? -ne 0 ]; then
echo "Fix code style before committing"
exit 1
fi
./vendor/bin/phpstan analyse
if [ $? -ne 0 ]; then
echo "Fix PHPStan errors before committing"
exit 1
fi
API Development
Testing API Endpoints
curl -X GET http://localhost/api/products
curl -X POST http://localhost/api/products \
-H "Content-Type: application/json" \
-d '{"name": "Test", "price": 1999}'
http GET localhost/api/products
http POST localhost/api/products name="Test" price:=1999
API Documentation
bin/console api:openapi:export --output=openapi.json
End of Day
Clean Up
docker compose down
docker compose stop
Commit Work
git status
git add -p
git commit -m "feat: add product filtering"
git push origin feature/product-filtering
Quick Reference
| Task | Command |
|---|
| Clear cache | bin/console cache:clear |
| Run migrations | bin/console doctrine:migrations:migrate |
| Load fixtures | bin/console doctrine:fixtures:load |
| Run tests | ./vendor/bin/pest |
| Fix code style | ./vendor/bin/php-cs-fixer fix |
| Static analysis | ./vendor/bin/phpstan analyse |
| Debug routes | bin/console debug:router |
| Debug services | bin/console debug:container |
| Consume messages | bin/console messenger:consume async |