im using console to call multiple vendor to publish my seeding data, but unfortunatelly i got this error
Artisan::call('vendor:publish',
[
'--provider' => 'Package\MyPackage\CoreServiceProvider',
'--tag' => 'seeds',
'--force' => true
]);
error message
[ErrorException]
Invalid argument supplied for foreach()
i remove --tag and no error
Artisan::call('vendor:publish',
[
'--provider' => 'Package\MyPackage\CoreServiceProvider',
'--force' => true
]);
when i run code on my terminal it's fine php artisan vendor:publish --provider="Package\MyPackage\CoreServiceProvider" --tag=seeds --force
after more trial and error i got solutions,
i must use array for --tag
parameter
Artisan::call('vendor:publish',
[
'--provider' => 'Package\MyPackage\CoreServiceProvider',
'--tag' => ['seeds'],
'--force' => true
]);