stephenjude/extended-artisan-commands
最新稳定版本:3.0.3
Composer 安装命令:
composer require stephenjude/extended-artisan-commands
包简介
Generate plain PHP files using artisan console commands.
README 文档
README
Have you ever enjoyed the assistance of artisan commands? This package brings more of it :)
You can now generate PHP classes and traits using artisan make:class, make:interface, make:trait or make:abstract-class console commands.
Installation
Step 1: Install Through Composer
composer require stephenjude/extended-artisan-commands --dev
Step 2: Run Artisan!
You're all set. Run php artisan from the console, and you'll see the new commands in the make:* namespace section.
- make:interface
- make:class
- make:abstract-class
- make:trait
- make:enum
Usage
Here's a few other examples of commands that you might write:
php artisan make:class Services/EmailForwarderService
php artisan make:abstract-class Services/AbstractEmailForwarder
php artisan make:interface EmailForwarderContract
php artisan make:trait FileUpload
php artisan make:enum Permission
Option for all the commands
--force This will overide the existing file, if it exist
Options for the make:class command
--interfaceOR-iThis will generate an interface for the generated class.--traitOR-tThis will generate a trait for the generated class.--abstractOR-cThis will generate an abstract class for the generated class.--allOR-aThis will generate an interface, a trait and an abstract class for the generated class.
Example:
This will generate an interface for this class.
php artisan make:class Services/EmailForwarderService --interface
This will generate a trait for this class.
php artisan make:class Services/EmailForwarderService --trait
Default Namespaces
- All interfaces are generated under the
App/Contractsnamespace. - All traits are generated under the
App/Traitsnamespace. - All enums are generated under the
App/Enumsnamespace. - Classes and abstract classes are generated under the
Appnamespace.
Default namespaces can be configured inside the package config file.
Configurations
You can configure default namespace by publishing the package config file:
php artisan vendor:publish --provider="Stephenjude\ExtendedArtisanCommands\ExtendedArtisanCommandsServiceProvider" --tag="config"
Configuring Default Namespace
return [ /* |-------------------------------------------------------------------------- | Default Class Namespace |-------------------------------------------------------------------------- | | Here you can configure the default namespace for | the make:class command. | */ 'class_namespace' => '', /* |-------------------------------------------------------------------------- | Default Abstract Class Namespace |-------------------------------------------------------------------------- | | Here you can configure the default namespace for | the make:abstract-class command. | */ 'abstract_class_namespace' => '', /* |-------------------------------------------------------------------------- | Default Interface Namespace |-------------------------------------------------------------------------- | | Here you can configure the default namespace for | the make:interface command. | */ 'interface_namespace' => '\Contracts', /* |-------------------------------------------------------------------------- | Default Trait Namespace |-------------------------------------------------------------------------- | | Here you can configure the default namespace for | the make:trait command. | */ 'trait_namespace' => '\Traits', /* |-------------------------------------------------------------------------- | Default Enum Namespace |-------------------------------------------------------------------------- | | Here you can configure the default namespace for | the make:enum command. | */ 'enum_namespace' => '\Enums', ];
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email stephenjudesuccess@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.
stephenjude/extended-artisan-commands 适用场景与选型建议
stephenjude/extended-artisan-commands 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14.12k 次下载、GitHub Stars 达 71, 最近一次更新时间为 2020 年 07 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「stephenjude」 「extended-artisan-commands」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 stephenjude/extended-artisan-commands 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 stephenjude/extended-artisan-commands 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 stephenjude/extended-artisan-commands 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Add default sorting column to your eloquent model
Filament Two Factor Authentication: Google 2FA + Passkey Authentication
A simple wallet implementation for Laravel
A simple Laravel API implementation for all payment providers like Paystack, Flutterwave, & Paypal etc.
Paystack Lite - Use Paystack Checkout Form on the go.
Laravel SDK for Providus Bank collection APIs
统计信息
- 总下载量: 14.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 71
- 点击次数: 17
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-27