Quick Commands to use | Cheat Sheet | General Purpose
- Posted on July 28, 2025
- Technology
- By MmantraTech
- 20 Views
Hello friends! This post help you remember most useful dev command. Very helpful when you deploy or debug in Symfony and Docker.
Symfony + Docker + Stripe: Developer Command Cheat Sheet
๐ง Symfony Console Commands
1. Consume Messages from Queue
docker compose exec php bin/console messenger:consume async --limit=100 --time-limit=60
2. Install Asset Files
docker compose exec php bin/console assets:install
3. Rebuild Pimcore Class Structure
docker compose exec php bin/console pimcore:deployment:classes-rebuild -d -c -v -f
4. Clear Symfony Cache
docker compose exec php bin/console cache:clear
๐ข๏ธ Doctrine Migrations
5. Generate Migration File
docker compose exec php bin/console doctrine:migrations:diff
This will compare your entity mappings vs DB and generate needed SQL.
6. Execute Specific Migration
docker compose exec php bin/console doctrine:migrations:execute --up Version20250330
7. Docker Execution of Migration
docker compose exec php bin/console doctrine:migrations:execute DoctrineMigrations\\Version20250318061433 --up
๐ณ Symfony JWT generate token
docker compose exec php /bin/console lexik:jwt:generate-keypair --skip-if-exists
๐ณ Docker + MySQL Admin
8. Drop and Recreate Symfony DB
docker compose exec database mysql -u root -proot -e "DROP DATABASE student; CREATE DATABASE student;"
9. Import SQL Dump
docker exec -i <image name or container id> mysql_ -u student -pstudent student < /path/to/your.sql
10. Dump SQL File
docker exec <image name or container id> mysqldump -u student -pstudent student > /path/backup.sql
๐ฅ Useful SQL + Docker Tips
11. Grant Admin Access
docker exec -it <image name or container id> mysql -u root -proot -e "CREATE USER 'admin'@'%' IDENTIFIED BY 'admin'; GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;"
12. Clean Up Docker
docker compose down --rmi all --volumes --remove-orphans
13. Reset Docker Temp
sudo rm -rf /var/lib/docker/tmp/*
๐ณ Stripe CLI
14. Forward Events to Localhost
stripe listen --forward-to http://localhost:8080/api/stripe/webhook
๐งช Git Development
16. Standard Commit Flow
git checkout -b feature/demo-1
git add .
git commit -m "demo commit"
git push origin feature/demo-1
๐ Conclusion
This cheat sheet can save you hours. Keep it bookmarked or embed in your team wiki. If you want more CLI tips or PHP tools, let me know in comments!
Write a Response