Laravel custom console command invoking constructor of all other custom commands

Laravel custom console command invoking constructor of all other custom commands

I have a set of console commands registered in app/Console/Kernel.php. My Kernel.php looks like,
< ?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        Commands\ConsoleCommand1::class,
        Commands\ConsoleCommand2::class
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule $schedule
     *
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        // Some code
    }
}

The structure of console command class looks like,
dependancy = $dependancy;
    }

    public function handle()
    {
        // Some 
Read more