承接 regnerisch/laravel-command-hooks 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

regnerisch/laravel-command-hooks

最新稳定版本:2.0.0

Composer 安装命令:

composer require regnerisch/laravel-command-hooks

包简介

README 文档

README

This package adds a before and after hook to Laravels command class.

Usage

The methods are only called if they are defined inside you class. If you do not need them, do not implement them. Returning a none zero value inside you before method will exit the execution immediately. Neither handle/ __invoke nor the after method will be called. The after method will get the exit code of the executed handle/ __invoke method, you can manipulate the exit code inside the after method and overwrite it by returning you own exit code. Returning null or nothing will keep the original exit code.

use \Regnerisch\LaravelCommandHooks\Command;

class MyCustomCommand extends Command
{
    protected function before(): ?int
    {
        // Do something before the command
        
        return $code;
    }
    
    protected function after(int $code): ?int
    {
        // Do something after the command
        
        return $code;
    }
    
    // ...
}

Contributors

License

ISC

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: ISC
  • 更新时间: 2022-09-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固