Search by

tomatophp / console-helpers

fadymondyqueents

tons of helper you need for you artisan command line application

Package info

github.com/tomatophp/console-helpers

pkg:composer/tomatophp/console-helpers

Fund package maintenance!

3x1io

Statistics

Installs: 581 819

Dependents: 156

Suggesters: 0

Stars: 5

Open Issues: 1

v1.1.0 2023-02-12 12:00 UTC

This package is auto-updated.

Last update: 2026-10-15 17:08:52 UTC


README

Screenshot

Laravel Console Helpers

Latest Stable Version License Downloads

tons of helper you need for you artisan command line application

⭐ If this package saves you time, star it and browse 60+ more Filament plugins at tomatophp.com/en/plugins.

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

More open source from the same author

  • TomatoPHP: 60+ open-source FilamentPHP plugins for Laravel
  • Laravilt: Laravel admin panels rendered with Inertia on Vue 3 or React 19
  • ToGO: the Laravel-style workflow for Go + React apps, with a plugin marketplace
  • Zekra: long-term memory for AI agents over MCP

Built by Fady Mondy.