Skip to content

Commit 0213c09

Browse files
committed
[Scheduler] Document hashed cron expressions
1 parent 26ba948 commit 0213c09

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

scheduler.rst

+17-4
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,28 @@ class, as shown in the following examples.
157157
Cron Expression Triggers
158158
~~~~~~~~~~~~~~~~~~~~~~~~
159159

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`_::
161168

162169
RecurringMessage::cron('* * * * *', new Message());
163170

164-
Before using it, you have to install the following dependency:
171+
You can also used some special values that represent common cron expressions:
165172

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 * * * *``
167178

168-
composer require dragonmantank/cron-expression
179+
For example::
180+
181+
RecurringMessage::cron('#daily', new Message());
169182

170183
.. tip::
171184

0 commit comments

Comments
 (0)