An expressive, human readable code generation tool.
byancode/blueprint is a Laravel package for an expressive, human readable code generation tool..
It currently has 1 GitHub stars and 13 downloads on Packagist (latest version v1.23.2).
Install it with composer require byancode/blueprint.
Discover more Laravel packages by byancode
or browse all Laravel packages to compare alternatives.
Last updated

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 and continue reading this document to get started.
Blueprint requires a Laravel application running version 6.0 or higher.
You can install Blueprint via composer using the following command:
composer require --dev laravel-shift/blueprint
Blueprint will automatically register itself using package discovery.
Additional Configuration: If you are running Laravel 8, or registering class-based routes or using the app/Models folder, you will need to configure Blueprint. Please review the Blueprint Docs for additional guidance.
Blueprint comes with a set of artisan commands. The one you'll use the most is the blueprint:build command to generate the Laravel components:
php artisan blueprint:build [draft]
The draft file contains a definition of the components to generate.
Let's review the following, example draft file to generate 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: post.index
From these simple 20 lines of YAML, Blueprint will generate all of the following Laravel components:
Post complete with fillable, casts, and dates properties, as well as relationships methods.posts table.PostController with index and store actions complete with code generated for each statement.PostController actions.StorePostRequest validating title and content based on the Post model definition.ReviewPost complete with a post property set through the constructor.SyncMedia complete with a post property set through the constructor.NewPost complete with a post property set through the constructor.post/index.blade.php rendered by PostController@index.Note: This example assumes features within a default Laravel application such as the User model and `app.blade.php
layout. Otherwise, the generated test may have failures.
Browse the Blueprint Docs for full details on defining models, defining controllers, advanced configuration, and extending Blueprint.