Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Canvas Laravel Package

orchestra/canvas

Orchestra Canvas brings Laravel’s artisan make:* generators to apps and packages. Generate controllers, models, migrations, jobs, mail, middleware, tests and more, with customizable namespaces and stubs—usable inside or outside a full Laravel install.

View on GitHub
Deep Wiki
Context7

Code Generators for Laravel Applications and Packages

Frequently asked questions about Canvas
Can I use orchestra/canvas to generate Laravel code outside a Laravel project (e.g., for package development)?
Yes, Canvas is designed for standalone package development. It replicates Laravel’s `make:*` commands without requiring a full Laravel installation, letting you scaffold controllers, models, migrations, and more using `canvas make:controller`, `canvas make:migration`, etc. Configure custom namespaces and stubs via `canvas.yaml` for consistency across projects.
How do I install orchestra/canvas in a Laravel project?
Run `composer require --dev orchestra/canvas` in your project. For Laravel apps, Canvas automatically overrides Artisan commands (e.g., `make:controller` becomes Canvas-enhanced). Use `composer exec canvas make:controller` to bypass conflicts or run side-by-side with custom commands.
Does orchestra/canvas support custom stubs for generated files?
Absolutely. Canvas uses stub templates (e.g., `model.stub`, `migration.stub`) in your project’s `resources/stubs` or a global `canvas.yaml` config. Override defaults for namespaces, annotations, or PHP 8.5+ features like enums. Stub customization is key for non-standard requirements or legacy syntax.
Which Laravel versions does orchestra/canvas support?
Canvas officially supports Laravel 11–13 and PHP 8.4–8.5. For older versions (e.g., Laravel 10 or PHP 8.1), you may need custom stubs or a fork. Check the [GitHub repo](https://github.com/orchestral/canvas) for version-specific notes, as major Laravel updates (e.g., 14+) could require Canvas updates.
Will orchestra/canvas conflict with my existing custom Artisan commands?
Canvas replaces native `make:*` commands by default. To avoid conflicts, use `composer exec canvas make:controller` explicitly or alias commands in your shell (e.g., `alias make=canvas`). If you’ve extended Laravel’s generators, review Canvas’s stubs or namespace handling to ensure compatibility.
Can I integrate orchestra/canvas into CI/CD pipelines for auto-generating tests or migrations?
Yes, Canvas works seamlessly in CI/CD. Use `composer exec canvas make:test` or `canvas make:migration` in scripts. For performance, cache stubs or parallelize generation (e.g., with Laravel Forge). Audit logs can track generated files by parsing Canvas’s output or using `canvas --log` flags.
How do I customize the namespace or class resolution for generated files?
Define custom namespaces in `canvas.yaml` under the `namespaces` key or override stubs to include dynamic placeholders like `{namespace}`. For example, set `namespaces: { App\Packages\MyPackage }` to prefix all generated classes. Canvas resolves classes relative to your project’s root or a specified path.
Are there alternatives to orchestra/canvas for Laravel code generation?
For Laravel-specific use, consider Laravel’s built-in `make:*` commands or packages like `laravel-shift/blueprint` for advanced scaffolding. For non-Laravel projects, tools like `laravel-zero` (for CLI apps) or `filp/whoops` (for error pages) offer niche solutions. However, Canvas uniquely bridges Laravel conventions with package development workflows.
How do I test or validate generated code from orchestra/canvas?
Canvas includes unit tests for core functionality, but validate edge cases (e.g., nested namespaces, custom paths) manually. Use `canvas make:model --test` to generate a model with test stubs, then run `phpunit` on the output. For CI, add a post-generation step to lint or analyze generated files with tools like `phpstan` or `psalm`.
What’s the best way to manage stub templates across multiple projects?
Centralize stubs in a monorepo or shared package (e.g., `company/stubs`) and reference them in `canvas.yaml` via `stubs_path`. For per-project customization, override stubs locally while inheriting defaults from the global config. Use version control to track stub changes and avoid drift from Laravel conventions.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai