erfanshk/laravel-layered-logic
Composer 安装命令:
composer require erfanshk/laravel-layered-logic
包简介
Layered Repositories, Services and Interfaces
关键字:
README 文档
README
Under Development - Beta Release
A simple package to make repositories , services and their corresponding interfaces for laravel.
Works on
Laravel ^11.0
How to Install
Just run the command below and everything is ready.
composer require erfanshk/laravel-layered-logic
How it works
LayeredLogicInitServiceProvider gets registered on your laravel app, which comes with a simple command
php artisan make:layered User
It creates the following files:
- App
- Layers
- Controllers
- UserController
- Requests
- UserRequest
- Resources
- UserResource
- Collection
- UserCollection
- Repositories
- UserRepository
- Interfaces
- UserRepositoryInterface
- Services
- UserService
- Interfaces
- UserServiceInterface
- Controllers
- Layers
It also registers repository and service interfaces as singletons in the published LayeredLogicServiceProvider in:
App\Providers\LayeredLogicServiceProvider
The binding array is located in
config\layered.php
By running:
php artisan make:layered {model}
it is automatically registered in the app container. Now you can use your pre-made UserService by injecting the UserServiceInterface anywhere in your application.
What you get by using this package?
It really depends on what coding style you have. LayeredLogic main objective is to bring abstraction to laravel models and controllers. It also makes the creating and registering of such easy and less time-consuming.
Development
If you have any ideas to enhance the package, I would be more than happy to hear from you.
erfanshk/laravel-layered-logic 适用场景与选型建议
erfanshk/laravel-layered-logic 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 07 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「repository」 「laravel」 「services」 「layered」 「laravel-repository」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 erfanshk/laravel-layered-logic 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 erfanshk/laravel-layered-logic 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 erfanshk/laravel-layered-logic 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
repository php library
Laravel 5 - Repositories to the database layer
Structure for the Laravel Service-Repository Pattern
Rinvex Repository is a simple, intuitive, and smart implementation of Active Repository with extremely flexible & granular caching system for Laravel, used to abstract the data layer, making applications more flexible to maintain.
Base Skeleton for Laravel Application
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-30