orchestra/canvas-core
Core utilities for Orchestra Canvas code generators. Build and customize generators for Laravel apps and packages, with testing and coverage support. Provides the foundational services used by Canvas to scaffold code and streamline development workflows.
Illuminate\Console\GeneratorCommand, ensuring native integration with Laravel’s service container, filesystem, and console tooling. Avoids reinventing the wheel by leveraging Laravel’s existing scaffolding infrastructure.App\Modules\{Module}\{Layer}) via presets, reducing deviation from architectural guidelines. Ideal for modular monoliths, microservices, or internal frameworks.GeneratesCodeListener for post-generation hooks (e.g., running migrations, publishing configs), enabling CI/CD integration or infrastructure-as-code workflows.PromptsForMissingInput and multi-step generators (e.g., make:api-resource --with-tests --with-migrations) improves developer experience over static stubs.orchestra/sidekick and workbench, these are optional for basic use cases, reducing bloat.Key Strengths:
✅ Reduces boilerplate by 50%+ for repetitive scaffolding.
✅ Enforces consistency via presets (e.g., naming, paths, PHPDoc standards).
✅ Extensible for custom generators (e.g., make:domain-service, make:contract).
✅ Laravel-native—no framework coupling issues.
Potential Misalignment:
⚠ Overkill for simple use cases (e.g., one-off make:controller).
⚠ Laravel version lock-in (v8.x for Laravel 10, v10.x for Laravel 11; v11.x claims for Laravel 13 are unverified).
⚠ Zero Packagist dependents suggests limited real-world validation.
composer require orchestra/canvas-core.resources/stubs/api-resource.stub) for team-specific logic.orchestra/sidekick/workbench (used only for advanced features like Actions).Integration Path:
make:api-resource, make:domain-layer).GeneratesCodeListener for post-generation tasks (e.g., migrations, config publishing).| Risk Area | Severity | Mitigation |
|---|---|---|
| Laravel Version Mismatch | High | Pin to orchestra/canvas-core:^8.11 for Laravel 10, test v10.x for Laravel 11. Avoid v11.x until Orchestra confirms stability. |
| Custom Generator Complexity | Medium | Start with simple generators (e.g., make:controller) before tackling dynamic logic. Use GeneratesCodeListener for edge cases. |
| Dependency Bloat | Low | orchestra/sidekick/workbench are optional; basic use requires only canvas-core. |
| Stub Maintenance | Medium | Store stubs in version control (e.g., resources/stubs/) and enforce PR reviews for changes. |
| Post-Generation Failures | Medium | Implement idempotent hooks (e.g., check if migration exists before running). |
| Adoption Resistance | High | Pilot with developer advocates, demonstrate time savings (e.g., "30% faster API scaffolding"). |
Critical Questions for TPM:
GeneratesCodeListener first.make:microservice --stack=Lumen) for platform teams.make:package-boilerplate).make:test-suite --type=unit) with standardized structures.Compatibility Matrix:
| Laravel Version | Canvas Core Version | Status |
|---|---|---|
| Laravel 10.x | orchestra/canvas-core:^8.11 |
✅ Recommended |
| Laravel 11.x | orchestra/canvas-core:^10.0 |
⚠ Tested (use caution) |
| Laravel 12.x | orchestra/canvas-core:^11.0 |
❌ Unverified |
| Laravel 13.x | orchestra/canvas-core:^11.0 |
❌ Unverified |
make:controller) with Canvas Core.App\Presets\ApiResource) for paths, stubs, and prompts.resources/stubs/ and version-control them.GeneratesCodeListener for post-generation tasks (e.g., migrations, config publishing).[Action] for workflows), requiring PHP 8.1+.orchestra/sidekick (optional).Sequencing Recommendations:
make:controller, make:migration).--with-tests, --with-migrations).GeneratesCodeListener).orchestra/sidekick/workbench for breaking changes (optional dependencies).storage/logs/artisan; use canvas:debug for troubleshooting.Maintenance Overhead: | Task | **
How can I help you explore Laravel packages today?