shamaseen/repository-generator
Composer 安装命令:
composer require shamaseen/repository-generator
包简介
repository pattern files generator
README 文档
README
IMPORTANT: We have created this repository to be a part of a specific workflow, it wasn't designed to be compatible with every project, but it became popular, so we decided to create a new better one with flexibility in mind, use this package instead.
Repository Generator
Autogeneration for repository pattern files, This package is aim to generate Contract (interface), Entity (model), Controller, Repository, Request validation and view files for specified module.
No Need to bind the interface to the repository, it will be auto-bind !
*Note: if you are using laravel, you should've at least version 5.7
Requirement
This package require the following dependencies: "illuminate/console": "^5.7", "illuminate/support": "^5.7"
Install
1- Require this package with composer using the following command:
composer require shamaseen/repository-generator
2- publish the package config file by running:
php artisan vendor:publish
and select repository-generator.
3- To enable validation messages to be delivereid, You need to move StartSession and ShareErrorsFromSession from $middlewareGroups in http karnel to $middleware.
Publish stubs
If you want to have a custom stubs rather than the default ones, you can change the path of the stubs folder in repository config, then run the following command:
php artisan vendor:publish
and select repository-stub, this will publish all the stub templates to the specified path on repository config. Feel free to edit stubs templates.
How to use
To generate repository files run the following command:
php artisan make:repository {Folder/Classname (singular)}
where Folder is optional.
To generate views and languages files just add --only-view option in the command.
To remove a repository files that has been already created, you can use Remover like the following:
php artisan remove:repository {Folder/Classname (singular)}
Examples
To generate repository files for product, run the following:
php artisan make:repository Products/Product
Note: You can use Product instead of Products/Product, this will not make new folder with the class.
Then generate views and languages files:
php artisan make:repository Products/Product --only-view
License
Repository-generator is a free software distributed under the terms of the MIT license.
shamaseen/repository-generator 适用场景与选型建议
shamaseen/repository-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17.5k 次下载、GitHub Stars 达 49, 最近一次更新时间为 2019 年 01 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 shamaseen/repository-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shamaseen/repository-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 17.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 50
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-08