queents/console-helpers

tons of helper you need for you artisan command line application

Fund package maintenance!
3x1io

v1.0.0 2023-01-24 18:25 UTC

This package is auto-updated.

Last update: 2024-11-30 01:57:56 UTC


README

tons of helper you need for you artisan command line application

Installation

composer require queents/console-helpers

Usage

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

Run PHP Command

you can run direct php command like this

use Queents\ConsoleHelpers\Traits\RunCommand;

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

Run Yarn Command

you can run direct yarn command like this

use Queents\ConsoleHelpers\Traits\RunCommand;

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

NOTE

you can update yarn path from config file.

Run Artisan Command

you can direct run artisan command by using this method

use Queents\ConsoleHelpers\Traits\RunCommand;

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

Handle Stubs File Template

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

use Queents\ConsoleHelpers\Traits\HandleStubs;

class MyCommand extends Command{
    use HandleStubs;
}
$this->generateStubs(
    __DIR__ . "/stubs/SettingsClass.stub",
    "Modules/Base/Settings/MainSettings.php",
    [
        "settingName" => "site_url",
        "moduleName" => "Base",
        "settingField" => Str::lower("site_url")
    ],
    [
        "Modules/Base/Settings/"
    ]
);

Handel Modules Actions

this command is working with laravel-modules you can active all modules or stop all modules or active selected module by this methods

use Queents\ConsoleHelpers\Traits\HandleModules;

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

this method take 2 parameter first is module name and second is active/stop bool by default is true

$this->activeModule("Base");

Support

you can join our discord server to get support VILT Admin

Docs

look to the new docs of v4.00 on my website Docs

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.