tomatophp/console-helpers 问题修复 & 功能扩展

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

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

tomatophp/console-helpers

最新稳定版本:v1.1.0

Composer 安装命令:

composer require tomatophp/console-helpers

包简介

tons of helper you need for you artisan command line application

README 文档

README

Screenshot

Laravel Console Helpers

Latest Stable Version License Downloads

tons of helper you need for you artisan command line application

Installation

composer require tomatophp/console-helpers

Usage

we have Traits that you can use in your artisan command class

Run PHP Command

you can run direct php command like this

use TomatoPHP\ConsoleHelpers\Traits\RunCommand;

class MyCommand extends Command{
    use RunCommand;
    
    public function handle(){
       $this->phpCommand('echo "welcome";');
    }
}

Run Yarn Command

you can run direct yarn commands like this

use TomatoPHP\ConsoleHelpers\Traits\RunCommand;

class MyCommand extends Command{
    use RunCommand;
    
    public function handle(){
       $this->yarnCommand('echo "welcome";');
    }
}

NOTE: you can update the yarn path from the config file.

Run Artisan Command

you can direct run the artisan command by using this method

use TomatoPHP\ConsoleHelpers\Traits\RunCommand;

class MyCommand extends Command{
    use RunCommand;
    
    public function handle(){
       $this->artisanCommand('migrate');
    }
}

Handle Stubs File Template

you can handle stubs file templates and copy change or add new data by using this method

use TomatoPHP\ConsoleHelpers\Traits\HandleStub;

class MyCommand extends Command{
    use HandleStub;
    
    public function handle(){
        $this->generateStubs(
            from: __DIR__ . "/stubs/SettingsClass.stub",
            to: "Modules/Base/Settings/MainSettings.php",
            replacements: [
                "settingName" => "site_url",
                "moduleName" => "Base",
                "settingField" => Str::lower("site_url")
            ],
            directory: [
                "Modules/Base/Settings/"
            ],
            append: false
        );
    }
}

Handel Modules Actions

this command is working with laravel-modules you can activate all modules or stop all modules or actively selected modules by this method

use TomatoPHP\ConsoleHelpers\Traits\HandleModules;

class MyCommand extends Command{
    use HandleModules;
    
    public function handle(){
        $this->activeAllModules();
        $this->stopAllModules();
    }
}

this method takes 2 parameters first is the module name and the second is the active/stop bool by default is true

$this->activeModule("Base");

Other Filament Packages

Checkout our Awesome TomatoPHP

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固