src/Http/Controllers/Controller.php
protected function runBeforeCommands($command)
    {
        $beforeCommands = $command::beforeCommands();

        if (!is_array($beforeCommands) && strlen(trim($beforeCommands)) > 0) {
            $beforeCommands = [$beforeCommands];
        }

        $this->dispatcher->pipeThrough($beforeCommands);
    }
protected function runBeforeCommands($command)
    {
        $beforeCommands = $command::beforeCommands();

        if (!is_array($beforeCommands) && strlen(trim($beforeCommands)) > 0) {
            $beforeCommands = [$beforeCommands];
        }

        $this->dispatcher->pipeThrough($beforeCommands);
    }
This method can be used in a controller before dispatching a command to pipe it.
It will check if the command has commands to run in the command pipeline.

@param string $command A command class name