laravel-shift / blueprint
An expressive, human readable code generation tool.
Installs: 1 156 391
Dependents: 37
Suggesters: 0
Security: 0
Stars: 3 082
Watchers: 52
Forks: 289
Open Issues: 12
pkg:composer/laravel-shift/blueprint
Requires
- illuminate/console: ^10.38|^11.0|^12.0
- illuminate/database: ^10.38|^11.0|^12.0
- illuminate/filesystem: ^10.38|^11.0|^12.0
- illuminate/support: ^10.38|^11.0|^12.0
- laravel-shift/faker-registry: ^0.3.0
- symfony/yaml: >=6.2
Requires (Dev)
- laravel/pint: ~1.18.0
- mockery/mockery: ^1.4.4
- orchestra/testbench: ^8.0|^9.0|^10.0
- phpunit/phpunit: ^10.0|^11.5.3
Suggests
- jasonmccreary/laravel-test-assertions: Required to use additional assertions in generated tests (^1.0).
- dev-master
- v2.12.0
- v2.11.1
- v2.11.0
- v2.10.0
- v2.9.0
- v2.8.1
- v2.8.0
- v2.7.0
- v2.6.1
- v2.6.0
- v2.5.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.25.0
- v1.24.2
- v1.24.1
- v1.24.0
- v1.23.3
- v1.23.2
- v1.23.1
- v1.23.0
- v1.22.0
- v1.21.0
- v1.20.2
- v1.20.1
- v1.20.0
- v1.19.2
- v1.19.1
- v1.19.0
- v1.18.0
- v1.17.0
- v1.16.0
- v1.15.3
- v1.15.2
- v1.15.1
- v1.15.0
- v1.14.0
- v1.13.2
- v1.13.1
- v1.13.0
- v1.12.0
- v1.11.2
- v1.11.1
- v1.11.0
- v1.10.1
- v1.10.0
- v1.9.1
- v1.9.0
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.0
- v1.5.1
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1
- dev-drop-l11
This package is auto-updated.
Last update: 2025-10-22 15:26:45 UTC
README
Blueprint is an open-source tool for rapidly generating multiple Laravel components from a single, human readable definition.
Watch a quick demo of Blueprint in action or continue reading to get started.
Requirements
Blueprint requires a Laravel application running a supported version of Laravel. Currently that is Laravel 11 or higher.
Installation
You may install Blueprint via Composer using the following command:
composer require -W --dev laravel-shift/blueprint
Blueprint will automatically register itself using package discovery.
If you wish to run the tests generated by Blueprint, you should also install the Additional Assertions package:
composer require --dev jasonmccreary/laravel-test-assertions
Basic Usage
Blueprint comes with a set of artisan commands. The one you'll use to generate the Laravel components is the blueprint:build command:
php artisan blueprint:build [draft]
The draft file contains a definition of the components to generate. Let's review the following example draft file which generates some blog components:
models: Post: title: string:400 content: longtext published_at: nullable timestamp author_id: id:user controllers: Post: index: query: all render: post.index with:posts store: validate: title, content, author_id save: post send: ReviewPost to:post.author.email with:post dispatch: SyncMedia with:post fire: NewPost with:post flash: post.title redirect: posts.index
From these 20 lines of YAML, Blueprint will generate all of the following Laravel components:
- A model class for
Postcomplete withfillable,casts, anddatesproperties, as well as relationships methods. - A migration to create the
poststable. - A factory intelligently setting columns with fake data.
- A controller class for
PostControllerwithindexandstoreactions complete with code generated for each statement. - Routes for the
PostControlleractions. - A form request of
StorePostRequestvalidatingtitleandcontentbased on thePostmodel definition. - A mailable class for
ReviewPostcomplete with apostproperty set through the constructor. - A job class for
SyncMediacomplete with apostproperty set through the constructor. - An event class for
NewPostcomplete with apostproperty set through the constructor. - A Blade template of
post/index.blade.phprendered byPostController@index. - An HTTP Test for the
PostController. - A unit test for the
StorePostRequestform request.
Note: This example assumes features within a default Laravel application such as the User model and app.blade.php layout. Otherwise, the generated tests may have failures.
Documentation
Browse the Blueprint Docs for full details on defining models, defining controllers, advanced configuration, and extending Blueprint.
Support Policy
Starting with version 2, Blueprint only generates code for supported versions of Laravel (currently Laravel 11 or higher). If you need to support older versions of Laravel, you may constrain Blueprint to an older version or upgrade your application (try using Shift).
Blueprint still follows semantic versioning. However, it does so with respect to its grammar. Any changes to the grammar will increase its major version number. Otherwise, minor version number increases will contain new features. This includes generating code for future versions of Laravel.
