Level 51
Artisan::call(DeleteDataForTeam::class, [
'--team' => 123,
'--force' -> true
]);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have two Artisan commands and I need to call one from the other. How do I properly call the second command when it has boolean options?
The signature for the first command is:
app:delete-data-for-team {--team=} {--force}
When I try to call that from the other command, I'm trying to pass the team parameter with an integer value and the force boolean option, like this:
Artisan::call(DeleteDataForTeam::class, [
'--team' => 123,
'--force'
]);
But DeleteDataForTeam doesn't get the --force parameter, so how can I pass a boolean option from one Artisan command to another?
Thank you
Artisan::call(DeleteDataForTeam::class, [
'--team' => 123,
'--force' -> true
]);
Please or to participate in this conversation.