stephenjude/extended-artisan-commands 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stephenjude/extended-artisan-commands

最新稳定版本:3.0.3

Composer 安装命令:

composer require stephenjude/extended-artisan-commands

包简介

Generate plain PHP files using artisan console commands.

README 文档

README

Latest Version on Packagist Build Status Total Downloads

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

  • --interface OR -i This will generate an interface for the generated class.
  • --trait OR -t This will generate a trait for the generated class.
  • --abstract OR -c This will generate an abstract class for the generated class.
  • --all OR -a This 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/Contracts namespace.
  • All traits are generated under the App/Traits namespace.
  • All enums are generated under the App/Enums namespace.
  • Classes and abstract classes are generated under the App namespace.

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 stephenjude/extended-artisan-commands 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 14.12k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 71
  • 点击次数: 17
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 71
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-27