models as $model) { // Call the seeder command $exitCode = \Artisan::call('seeding:image', ['directory' => $this->argument('directory'), 'model' => $model]); // Get the output $output = \Artisan::output(); // Handle the exit code and output as needed if ($exitCode === 0) { $this->info( "Seeding was successful: [$model] \n"); } else { $this->error("Seeding failed with exit code {$exitCode}:\n"); } $this->info( $output); } } }