I am trying to run a array of command from another command. somthing similar to cronjob but with a view edit add option by end user. this is working :
$fooCommand = new \App\Command\fooCommand();
$barCommand = new \App\Command\barCommand();
but what i need is :
$classes = [
"foo",
"bar"
];
foreach ($classes as $class) {
$otherCommand = new '\\App\\Command\\' .$class. Command();
# code...
}
something similar to that. iterate in an array and initiate the class. practically running the commands from the database.