Advanced command

  • With category
  • With parameter
<?php
 
namespace App\Commands;
 
use Bypc\Commander;
use Bypc\Core;
 
class Make extends Commander {
    protected string $name = 'make';
    protected string $description = 'Generates project files.';
 
    protected bool $paramRequired = true;
    protected bool $categoryRequired = true;
    protected array $categoriesTrusted = ['controller', 'model', 'seed'];
 
    public function handler(Core $tool, string|null $param, string|null $category) {
        $this->checkRulers($param, $category);
 
        // code
    }
}