Cron & Scheduled

20. Cron & Scheduled Tasks

Foodie runs two recurring jobs from the Admin Panel, both triggered by Laravel’s scheduler:

  • app:auto-cancel-order — cancels orders that were never accepted within the window you configure.
  • app:send-scheduled-order-notification — sends reminders for orders customers scheduled for later.

Both shell out to the Node scripts in storage/app/firebase/, so they will not run until the Node path is set.

20.1. Configure the Node binary path

Set NODE_PATH in the Admin Panel’s .env to the absolute path of your Node executable — for example /usr/local/bin/node on Linux, or C:/Program Files/nodejs/node.exe on Windows. Find it with which node (see Installing Node.js & npm).

NODE_PATH='/usr/local/bin/node'

20.2. Add the Laravel scheduler to cron

Add a single cron entry that runs the scheduler every minute. Laravel then decides which of its commands are due.

* * * * * cd /path-to-your-admin-panel && php artisan schedule:run >> /dev/null 2>&1

In cPanel, open Cron Jobs, choose Once Per Minute, and paste the command.

Please note: use the correct PHP binary path for your server (/usr/local/bin/php is common but varies), point the command at your own admin-panel directory, and make sure the panel’s files are readable and storage/ is writable by the cron user.

20.3. Timing values

The cron entry only decides how often Laravel is asked. The actual timings come from the admin panel: the auto-cancellation window under Settings, and the reminder lead time under Settings → Schedule Order Notification.

Recent Posts

    Archives

    No archives to show.

    Categories

    • No categories

    Blog Categories

    • No categories

    Archives

      Categories

      • No categories