在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):laravel-shift/blueprint开源软件地址(OpenSource Url):https://github.com/laravel-shift/blueprint开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):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. RequirementsBlueprint requires a Laravel application running the latest stable release of Laravel, currently Laravel 8.x. InstallationYou 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 Basic UsageBlueprint comes with a set of artisan commands. The one you'll use the most is the 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:
Note: This example assumes features within a default Laravel application such as the DocumentationBrowse the Blueprint Docs for full details on defining models, defining controllers, advanced configuration, and extending Blueprint. Support PolicyStarting with version 2, Blueprint only generates code for the latest stable version of Laravel (currently Laravel 9). If you need to support older versions of Laravel, you may use version 1 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. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论