Weave 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

Blacksmith Laravel Package

mpociot/blacksmith

Blacksmith is a Laravel code generation tool that turns a simple YAML schema definition into Eloquent models, migrations, and related scaffolding, cutting boilerplate when starting new projects or adding database-backed features.

View on GitHub
Deep Wiki
Context7

Blacksmith is a Laravel code-generation package that turns a table schema or set of field definitions into ready-to-use application code. Instead of writing boilerplate by hand, you describe the resource and Blacksmith scaffolds the matching models, controllers, migrations, and Blade views, following Laravel conventions so the output feels native to your project.

  • Generates complete CRUD scaffolding from field definitions
  • Artisan commands for fast, repeatable generation
  • Customizable stubs so output matches your code style
  • Configurable output paths and namespaces
  • Convention-driven defaults that work out of the box
Frequently asked questions about Blacksmith
How do I install mpociot/blacksmith in a Laravel app?
Install it as a dev dependency with composer require --dev mpociot/blacksmith, then publish the config and stubs using vendor:publish and confirm the Artisan command name before running anything. The gating step is composer why-not mpociot/blacksmith against your target app, because the last release was November 2016 and it will not resolve on PHP 8 or Laravel 8 and above. On a legacy Laravel 5.x codebase the install is mechanically trivial; on a modern stack treat it as read-only reference material rather than something you ship.
Does mpociot/blacksmith support Laravel 8, Laravel 9 or PHP 8?
No. The last release was November 2016 and there is no maintenance path, so expect a hard stop on PHP 8+ and Laravel 8+ when Composer resolves constraints. Run composer why-not mpociot/blacksmith to see exactly which platform requirements block it in your application. It is genuinely viable only in a legacy Laravel 5.x, pre-PHP 8 codebase already pinned to that era.
What does Blacksmith actually generate from a schema?
Blacksmith turns a table schema or YAML field definition into ready-to-use Laravel code: Eloquent models, migrations, controllers, routes, factories, Blade views and optionally PHPUnit tests. Output follows Laravel conventions so it feels native to the project rather than bolted on. The real value sits in the schema grammar and the publishable stubs directory; everything else is plumbing around them.
What is the schema format used by Blacksmith?
You describe a resource with models, fields and relationships in a simple YAML schema definition, and Blacksmith emits the matching scaffolding. The schema grammar and stubs are the two surfaces worth studying if you plan to borrow the design for your own generator. Relationship declarations deserve explicit model-and-migration review, because a misdeclared relationship can silently produce a plausible belongsTo with the wrong foreign key.
Is mpociot/blacksmith still maintained?
No. The last release was November 2016, there is no upstream, no security path and no compatibility work. The repository shows roughly 103 stars, zero dependents, no issue activity and no vendor backing. Any patch you need is yours to write and keep forever.
Why does Composer describe Blacksmith as the unofficial Laravel Forge API?
That is stale package metadata: the description calls it an unofficial Forge API client while the repository and docs describe a schema-to-CRUD scaffolder. These are two different products with different risk profiles, and the code plus the majority of evidence point to the scaffolder. Confirm which artifact you are evaluating and correct the metadata record before any roadmap item cites Blacksmith by name. Stale metadata is itself a trust signal worth weighing.
Is it safe to run Blacksmith in a production application?
Blacksmith is a build-time scaffolder, not a runtime library, so the package never sits in the request path and the blast radius is limited to the source files you review and commit. The real risks are in the output: silent correctness drift on relationship declarations and destructive regeneration that overwrites hand edits. Adopting it as-is is defensible mainly for throwaway demos, spikes and internal admin tooling on a legacy stack, with a rewrite expected.
Will re-running Blacksmith overwrite my hand-edited files?
Yes. There is no three-way merge, so regenerating a resource overwrites edits you made to previously generated models, controllers or views. Generate early, commit the output so you have a clean diff, and avoid treating the command as a repeatable codegen step on files you have since customised. If you need repeatable regeneration with merge safety, you want a generator your team owns.
Can I customise the stubs and output paths Blacksmith generates?
Yes. You can publish the stubs and edit them so the generated code matches your style, and the configuration exposes output paths and namespaces so classes land where your project expects them. Convention-driven defaults work out of the box, but customising the stubs is where teams get most of the value. Remember that stub changes live in your application, not upstream, so you own them indefinitely.
What should I use instead of Blacksmith on a modern Laravel stack?
Borrow the design rather than the dependency: read the schema parser, the Artisan command class and the stubs, then write a small internal make:resource-style command with your own templates. That costs a few days of engineering and gives you convention control plus an upgrade path the package does not have. Forking and owning it is only reasonable if a legacy app makes reimplementation uneconomic and a named PHP/Laravel owner accepts indefinite maintenance. Also watch dependency-lock drag, since even a dev-only dependency with old framework constraints can block composer update long after the motivating feature is gone.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections