codebider/service-generator-tool
Composer 安装命令:
composer require codebider/service-generator-tool
包简介
A Laravel package to generate service classes using an Artisan command.
README 文档
README
Laravel Service Generator
A simple yet powerful Laravel package to generate service classes using an Artisan command.
📦 Installation
You can install the package via Composer:
composer require codebider/service-generator-tool
If you’re using Laravel < 5.5, add the service provider manually in config/app.php:
'providers' => [ CodeBider\ServiceGenerator\ServiceGeneratorServiceProvider::class, ];
⚙️ Configuration (Optional)
You can publish the config and stub file using:
php artisan vendor:publish --provider="CodeBider\ServiceGenerator\ServiceGeneratorServiceProvider"
This will publish:
config/service-generator.phpstubs/service.stub
🧪 Usage
Generate a new service class using:
php artisan make:service {name}
php artisan make:service InventoryService
This will create the service class in the configured path named as InventoryService (default: app/Services).
🛠 Configuration Options
File: config/service-generator.php
return [ 'namespace' => 'App\\Services', 'path' => app_path('Services'), ];
✏️ Custom Stub
By default, the package provides a service.stub file. You can customize the stub by modifying the published file:
/stubs/service.stub
The stub supports two variables:
{{ namespace }}{{ class }}
Example stub:
<?php namespace {{ namespace }}; class {{ class }} { // }
✅ Testing
composer test
📄 License
This package is open-sourced software licensed under the MIT license.
👤 Author
Developed with ❤️ by Awais Javaid
📦 Package: codebider/service-generator
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request or open an issue.
codebider/service-generator-tool 适用场景与选型建议
codebider/service-generator-tool 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 55 次下载、GitHub Stars 达 4, 最近一次更新时间为 2025 年 04 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「generator」 「service」 「laravel」 「artisan」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 codebider/service-generator-tool 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 codebider/service-generator-tool 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 codebider/service-generator-tool 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
A fast and intuitive dependency injection container.
Registry service.
swagger-php - Generate interactive documentation for your RESTful API using phpdoc annotations
Service auto install for Nette Framework
Structure for the Laravel Service-Repository Pattern
统计信息
- 总下载量: 55
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-22