@@ -157,15 +157,28 @@ 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
164
- Before using it, you have to install the following dependency :
171
+ You can also used some special values that represent common cron expressions :
165
172
166
- .. code-block :: terminal
173
+ * ``#yearly ``, ``#annually `` - Run once a year, midnight, Jan. 1 - ``0 0 1 1 * ``
174
+ * ``#monthly `` - Run once a month, midnight, first of month - ``0 0 1 * * ``
175
+ * ``#weekly `` - Run once a week, midnight on Sun - ``0 0 * * 0 ``
176
+ * ``#daily ``, ``#midnight `` - Run once a day, midnight - ``0 0 * * * ``
177
+ * ``#hourly `` - Run once an hour, first minute - ``0 * * * * ``
167
178
168
- composer require dragonmantank/cron-expression
179
+ For example::
180
+
181
+ RecurringMessage::cron('#daily', new Message());
169
182
170
183
.. tip ::
171
184
0 commit comments