diff --git a/scheduler.rst b/scheduler.rst index c0db986d8c0..d25c9163df8 100644 --- a/scheduler.rst +++ b/scheduler.rst @@ -455,6 +455,11 @@ The attribute takes more parameters to customize the trigger:: // defines the timezone to use #[AsCronTask('0 0 * * *', timezone: 'Africa/Malabo')] + // when applying this attribute to a Symfony console command, you can pass + // arguments and options to the command using the 'arguments' option: + #[AsCronTask('0 0 * * *', arguments: 'some_argument --some-option --another-option=some_value')] + class MyCommand extends Command + .. _scheduler-attributes-periodic-task: ``AsPeriodicTask`` Example @@ -499,6 +504,11 @@ The ``#[AsPeriodicTask]`` attribute takes many parameters to customize the trigg } } + // when applying this attribute to a Symfony console command, you can pass + // arguments and options to the command using the 'arguments' option: + #[AsPeriodicTask(frequency: '1 day', arguments: 'some_argument --some-option --another-option=some_value')] + class MyCommand extends Command + Managing Scheduled Messages ---------------------------