PHP code example of alighorbani1381 / command-manager

1. Go to this page and download the library: Download alighorbani1381/command-manager library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alighorbani1381 / command-manager example snippets

 bash
php artisan migrate
 bash
php artisan vendor:publish --provider="Alighorbani\CommandManager\CommandManagerServiceProvider"
 php


namespace App\Console\Command;

use Alighorbani/CommandManager/AutomaticComand;

class MyCommand exnteds AutomaticCommand
{
    protected $signature = 'my:command';
    
    protected $description = 'My command to normalize data';
    
    protected function handle()
    {
        // functionality implemented here 
    }
}
 php


use App\Console\Command\MyCommand;

return [
    // config here
    // another config here
    'commands' => [
        MyCommand::class, // 👈️👈️👈️ Add This
    ]
];
 bash
php artisan command_manager:status
 bash
php artisan command_manager:execute
 bash
php artisan command_manager:reset
 php
return [

    //  here 👇️
    'maintenance-mode' => [
        'on' => fn() => 'turn on',
        'off' => fn() => 'turn off'
    ],
    
    ...

];