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 to get started.
Blueprint requires a Laravel application running the latest stable release of Laravel, currently Laravel 8.x.
You can install Blueprint via composer using the following command:
composer require --dev laravel-shift/blueprint
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:
published_at: nullable timestamp
render: post.index with:posts
validate: title, content, author_id
send: ReviewPost to:post.author.email with:post
dispatch: SyncMedia with:post
fire: NewPost with:post
From these simple 20 lines of YAML, Blueprint will generate all of the following Laravel components:
Post complete with fillable,
dates properties, as well as relationships methods.
PostController with index and store actions complete with code generated for each statement.
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
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.
For more details, you can visit it’s documentation here.
The team of Codebrisk Laravel developers is always ready to execute even your boldest ideas. Our expert team can design and develop any type of custom CRM solution, SAAS app, or e-commerce app to meet our customer’s needs and transform our customer’s experiences. Get in touch with our team to discuss your bespoke ideas and learn more about the next steps to launching cooperation.
Published at : 28-09-2022
I am a highly results-driven professional with 12+ years of collective experience in the grounds of web application development especially in laravel, native android application development in java, and desktop application development in the dot net framework. Now managing a team of expert developers at Codebrisk.