@@ -157,7 +157,14 @@ class, as shown in the following examples.
157
157
Cron Expression Triggers
158
158
~~~~~~~~~~~~~~~~~~~~~~~~
159
159
160
- It uses the same syntax as the `cron command-line utility `_::
160
+ Before using cron triggers, you have to install the following dependency:
161
+
162
+ .. code-block :: terminal
163
+
164
+ $ composer require dragonmantank/cron-expression
165
+
166
+ Then, define the trigger date/time using the same syntax as the
167
+ `cron command-line utility `_::
161
168
162
169
RecurringMessage::cron('* * * * *', new Message());
163
170
@@ -168,11 +175,17 @@ It uses the same syntax as the `cron command-line utility`_::
168
175
169
176
The feature to define the cron timezone was introduced in Symfony 6.4.
170
177
171
- Before using it, you have to install the following dependency :
178
+ You can also use some special values that represent common cron expressions :
172
179
173
- .. code-block :: terminal
180
+ * ``#yearly ``, ``#annually `` - Run once a year, midnight, Jan. 1 - ``0 0 1 1 * ``
181
+ * ``#monthly `` - Run once a month, midnight, first of month - ``0 0 1 * * ``
182
+ * ``#weekly `` - Run once a week, midnight on Sun - ``0 0 * * 0 ``
183
+ * ``#daily ``, ``#midnight `` - Run once a day, midnight - ``0 0 * * * ``
184
+ * ``#hourly `` - Run once an hour, first minute - ``0 * * * * ``
185
+
186
+ For example::
174
187
175
- composer require dragonmantank/cron-expression
188
+ RecurringMessage::cron('#daily', new Message());
176
189
177
190
.. tip ::
178
191
0 commit comments