Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mstralka's avatar

How to pass boolean options when calling another Artisan command

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

0 likes
2 replies
mstralka's avatar

@MohamedTammam Thank you - I thought I tried that already but now it's working. Thanks for the quick reply.

1 like

Please or to participate in this conversation.