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

Scaffolder Laravel Package

spiral/scaffolder

Spiral Framework scaffolder module for generating and wiring up application code. Provides scaffolding tools and templates to speed up project setup and common development tasks, with CI-tested quality (PHPUnit/Psalm) and documentation on spiral.dev.

View on GitHub
Deep Wiki
Context7

Getting Started

Begin by installing the package via Composer (composer require spiral/scaffolder --dev). Once installed, register the loader in your bootstrap (bootstrap/app.php) by including Spiral\Scaffolder\Loader\Loader::class. The entry point is the php app.php CLI (Spiral’s console), where you’ll find scaffolding commands prefixed with scaffold:. Start with php app.php list scaffold to see available generators (e.g., scaffold:controller, scaffold:config, scaffold:migration). The first real use case is generating a new module’s skeleton with php app.php scaffold:module YourModuleName, which creates a self-contained module directory (src/YourModule) with core files like Module.php, Config.php, and routes.

Implementation Patterns

Typical workflows involve using scaffolder during onboarding or feature development to enforce structure. For example:

  • Run scaffold:controller with --resource to generate a full resource controller (index, create, store, etc.) alongside a stub view and request validation class.
  • Use scaffold:config to generate namespaced config files under config/YourModule/, then symlink them into the main app/config/ if desired.
  • For recurring patterns, create custom templates by extending Spiral\Scaffolder\Template\AbstractTemplate and register them as services—this allows teams to codify internal conventions (e.g., service providers with injection helpers).
  • Scaffolder integrates well with spiral/framework’s module system: after scaffolding, scaffold:module output automatically participates in Spiral’s auto-discovery and config loading when the module is loaded via Modules::addModule().

Gotchas and Tips

  • The last release is from 2020—verify compatibility with your Spiral version (works best with Spiral ~2.7–2.8; may need patches for 3.x). Check source for community forks if actively maintained elsewhere.
  • Template resolution depends on strict directory naming and PSR-4; misconfigured namespaces or incorrect template paths cause silent failures or partial file generation.
  • --force is often needed to overwrite existing files during refactoring, but always back up or version-control scaffolds first—accidental overwrites are common.
  • Custom templates should implement generate() and use $this->writeFile() instead of direct filesystem calls for clean rollback via the internal transaction system.
  • Despite low stars, its patterns align with Spiral’s module-first philosophy; many teams use it locally via git submodules or copied templates to avoid dependency staleness.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport