leinbg/make-package

artisan 命令制作带有基本脚手架的包

0.1.2 2017-05-11 08:31 UTC

This package is not auto-updated.

Last update: 2024-09-29 02:49:41 UTC


README

创建 Laravel 包脚手架

如何使用

  • 将命令服务提供者添加到应用配置
Leinbg\Command\MakePackage\Providers\ConsoleServiceProvider::class,
  • 创建包
php artisan make:package vendor package
  • 在 composer.json 中添加自动加载
"Vendor\\Package\\": "packages/vendor/package/src"
composer dumpautoload
  • 在应用配置中注册服务提供者
Vendor\Package\Providers\PackageServiceProvider::class,
  • 迁移 | 如果需要则发布

待办事项

  • 供应商和包驼峰命名
  • 添加更多选项
    • --default
    • --resource
    • --web
    • --cli

默认包结构

  • 数据库
    • 迁移
  • 资源
    • 视图
  • 路由
  • src
    • Http
      • 控制器
      • 请求
    • 模型
    • 提供者
  • composer.json