承接 laravel-shift/blueprint 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laravel-shift/blueprint

Composer 安装命令:

composer require laravel-shift/blueprint

包简介

An expressive, human readable code generation tool.

README 文档

README

Build Status Latest Stable Version License

Blueprint

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

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 Post complete with fillable, casts, and dates properties, as well as relationships methods.
  • A migration to create the posts table.
  • A factory intelligently setting columns with fake data.
  • A controller class for PostController with index and store actions complete with code generated for each statement.
  • Routes for the PostController actions.
  • A form request of StorePostRequest validating title and content based on the Post model definition.
  • A mailable class for ReviewPost complete with a post property set through the constructor.
  • A job class for SyncMedia complete with a post property set through the constructor.
  • An event class for NewPost complete with a post property set through the constructor.
  • A Blade template of post/index.blade.php rendered by PostController@index.
  • An HTTP Test for the PostController.
  • A unit test for the StorePostRequest form 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.

laravel-shift/blueprint 适用场景与选型建议

laravel-shift/blueprint 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.52M 次下载、GitHub Stars 达 3.11k, 最近一次更新时间为 2019 年 11 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「framework」 「code generation」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 laravel-shift/blueprint 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 laravel-shift/blueprint 我们能提供哪些服务?
定制开发 / 二次开发

基于 laravel-shift/blueprint 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.52M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3108
  • 点击次数: 30
  • 依赖项目数: 37
  • 推荐数: 0

GitHub 信息

  • Stars: 3105
  • Watchers: 52
  • Forks: 294
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-06