matheusfsc28/layercraft
Composer 安装命令:
composer require matheusfsc28/layercraft
包简介
A package to generate layered architecture (Controller, Service, Interface, Repository, Model) in Laravel applications.
README 文档
README
LayerCraft_PT
LayerCraft é um pacote para gerar uma arquitetura em camadas (Controller, Service, Interface, Repository, Model) em aplicações Laravel. Ele facilita a organização do código e promove boas práticas de desenvolvimento de maneira ágil.
Instalação
Você pode instalar o pacote via Composer. Execute o seguinte comando no seu terminal:
composer require matheusfsc28/layercraft
Como usar
No seu terminal, na pasta do seu projeto Laravel, execute o seguinte comando:
php artisan layercraft <YourClassName>
Isso criará a seguinte estrutura no projeto:
/seu-projeto ├── app/ │ ├── Http/ │ │ └── Controllers/ │ │ └── <YourClassName>Controller.php │ ├── Interfaces/ │ │ └── <YourClassName>Interface.php │ ├── Models/ │ │ └── <YourClassName>.php │ ├── Repositories/ │ │ └── <YourClassName>Repository.php │ └── Services/ │ └── <YourClassName>Service.php
Você também pode criar suas subpastas para manter a organização de acordo com suas necessidades:
php artisan layercraft <YourSubFolder>\<YourClassName>
A estrutura ficará da seguinte maneira:
/seu-projeto ├── app/ │ ├── Http/ │ │ └── Controllers/ │ │ └── <YourSubFolder>/ │ │ └── <YourClassName>Controller.php │ ├── Interfaces/ │ │ └── <YourSubFolder>/ │ │ └── <YourClassName>Interface.php │ ├── Models/ │ │ └── <YourSubFolder>/ │ │ └── <YourClassName>.php │ ├── Repositories/ │ │ └── <YourSubFolder>/ │ │ └── <YourClassName>Repository.php │ └── Services/ │ └── <YourSubFolder>/ │ └── <YourClassName>Service.php
Estrutura Detalhada
- Controllers: Contém a lógica do controlador.
- Interfaces: Define a interface que o repositório deve implementar.
- Models: Representa a entidade no banco de dados.
- Repositories: Contém a lógica de acesso a dados.
- Services: Implementa a lógica de negócios.
Licença
Este projeto está licenciado sob a Licença MIT. Veja o arquivo LICENSE para mais detalhes.
Contato
Se você tiver dúvidas ou sugestões, entre em contato:
- Nome: Matheus Felipe
- Email: dev.matheusfelipe@gmail.com
- GitHub:
- LinkedIn:
LayerCraft_EN
LayerCraft is a package to generate a layered architecture (Controller, Service, Interface, Repository, Model) in Laravel applications. It helps organize the code and promotes good development practices in an agile way.
Installation
You can install the package via Composer. Run the following command in your terminal:
composer require matheusfsc28/layercraft
How to use
In your terminal in the root of your Laravel project, run the following command:
php artisan layercraft <YourClassName>
This will create the following structure in the project:
/your-project ├── app/ │ ├── Http/ │ │ └── Controllers/ │ │ └── <YourClassName>Controller.php │ ├── Interfaces/ │ │ └── <YourClassName>Interface.php │ ├── Models/ │ │ └── <YourClassName>.php │ ├── Repositories/ │ │ └── <YourClassName>Repository.php │ └── Services/ │ └── <YourClassName>Service.php
You can also create your subfolders to keep according to your organization:
php artisan layercraft <YourSubFolder>\<YourClassName>
The structure will be as follows:
/your-project ├── app/ │ ├── Http/ │ │ └── Controllers/ │ │ └── <YourSubFolder>/ │ │ └── <YourClassName>Controller.php │ ├── Interfaces/ │ │ └── <YourSubFolder>/ │ │ └── <YourClassName>Interface.php │ ├── Models/ │ │ └── <YourSubFolder>/ │ │ └── <YourClassName>.php │ ├── Repositories/ │ │ └── <YourSubFolder>/ │ │ └── <YourClassName>Repository.php │ └── Services/ │ └── <YourSubFolder>/ │ └── <YourClassName>Service.php
Detailed Structure
- Controllers: Contains the controller logic.
- Interfaces: Defines the interface that the repository must implement.
- Models: Represents the entity in the database.
- Repositories: Contains the data access logic.
- Services: Implements the business logic.
Contact
If you have any questions or suggestions, please contact:
- Name: Matheus Felipe
- Email: dev.matheusfelipe@gmail.com
- GitHub:
- LinkedIn:
matheusfsc28/layercraft 适用场景与选型建议
matheusfsc28/layercraft 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.22k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 10 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 matheusfsc28/layercraft 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 matheusfsc28/layercraft 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-19