Scheduled commands cannot handle boolean options according to the documentation.
Steps To Reproduce
Create a command (e.g. app:do-thing with a boolean option (say --force). Schedule that command with the boolean option being called (Schedule::command('app:do-thing', ['--force' => true]) in the routes/console.php file). Run the schedule, and you'll get The "--force" option does not accept a value.
Furthermore, if you run php artisan shedule:list you'll see that the command has been improperly parsed so that the command now is app:do-thing --force='1', which is wrong and understandably causes that error.
Below are screenshots showing my command signature, my console.php file, the output of php artisan schedule:list and the flare report.
Drat. I was looking at the wrong documentation. I was looking at calling commands from other code, and that's different from registering it for the cron.
Laravel Version
11.22.0
PHP Version
8.2.22
Database Driver & Version
mysql5.5.5-10.5.26-MariaDB
Description
Scheduled commands cannot handle boolean options according to the documentation.
Steps To Reproduce
Create a command (e.g.
app:do-thing
with a boolean option (say--force
). Schedule that command with the boolean option being called (Schedule::command('app:do-thing', ['--force' => true])
in the routes/console.php file). Run the schedule, and you'll getThe "--force" option does not accept a value
.Furthermore, if you run
php artisan shedule:list
you'll see that the command has been improperly parsed so that the command now isapp:do-thing --force='1'
, which is wrong and understandably causes that error.Below are screenshots showing my command signature, my console.php file, the output of
php artisan schedule:list
and the flare report.