Created custom commands to import the data(Not a shell comand), I want to execute the command from the controller, Let me know how can I execute the command in cakephp4 controller.
I tried to use
use Cake\Console\CommandRunner;
$command = new CommandRunner();
$command->run([‘import_users’]);
But I am getting below error while creating object**($command = new CommandRunner();)**
“Too few arguments to function Cake\Console\CommandRunner::__construct()”