Skip to content
porro

Get started

Scheduled reports

Set up the cron job or scheduler that sends a connected PHP site's report every 15 minutes, on Forge, Ploi, Laravel Cloud, cPanel or any server.

A connected PHP site reports every 15 minutes, from a scheduled job on its server. Until that job runs, Porro shows the site's scheduler as not running.

Site What runs How often
Laravel, Filament or Statamic php artisan schedule:run, Laravel's scheduler Every minute
Craft CMS php craft porro/report --scheduled Every 15 minutes

Run it as the site's own user, never root, from the site's folder. If the site deploys with zero downtime (Forge, Ploi or Envoyer), use the current folder, e.g. /home/forge/example.com/current, never a folder under releases/: the next deploy leaves that release behind and later deletes it.

Laravel sites need the scheduler running once. If it already runs for the site's own tasks, there's nothing to add: a second copy would run every task twice.

Let Porro add it

When Porro installs the connector with a pull request on Forge or Ploi, it also sets up the schedule, run as the site's user, and leaves an existing one alone:

  • Forge: Forge's Laravel scheduler for Laravel, Filament and Statamic, or a scheduled job running porro/report every 15 minutes for Craft, with a heartbeat.
  • Ploi: a cron job on the server running Laravel's scheduler every minute, or porro/report every 15 minutes for Craft.

This needs the optional server:create-schedulers scope on your Forge token, or Cronjobs → Create on your Ploi key. Without it, the install still works and the step says add cron by hand: follow your host below. What each scope is used for is on the Laravel Forge and Ploi pages.

Add it yourself

connect offers to add the line to the server's crontab for you: php artisan porro:cron (php craft porro/cron on Craft) adds it later, without the key. On a host with its own scheduler page, add it there instead, so it's visible and survives the server being rebuilt.

Laravel Forge

Laravel, Filament or Statamic: open the site, then Processes → Scheduler, and turn on Laravel scheduler. Forge runs schedule:run every minute from the right folder.

Craft: open the site, then Processes → Scheduler → New scheduled job:

  1. Command: php /home/forge/example.com/current/craft porro/report --scheduled. Drop /current if the site doesn't use zero-downtime deployments, and use the site's PHP version if it isn't the server's default, e.g. php8.4.
  2. User: the site's user, forge unless the site is isolated.
  3. Frequency: Custom, */15 * * * *.
  4. Turn on Heartbeat so Forge tells you if it stops.
Ploi

Open the server, then Cronjobs, and add:

  1. Command: php /home/ploi/example.com/artisan schedule:run for Laravel, Filament or Statamic, or php /home/ploi/example.com/craft porro/report --scheduled for Craft. With zero-downtime deployments, add /current after the site's folder.
  2. User: the site's user, usually ploi.
  3. Frequency: every minute (* * * * *) for Laravel, or every 15 minutes (*/15 * * * *) for Craft.
Laravel Cloud

Open the environment, edit its App cluster, turn on Scheduler, then save and redeploy. Cloud runs schedule:run every minute, so there's no cron line to add. Set PORRO_KEY in the environment's variables.

Laravel Vapor

Vapor runs the scheduler every minute unless vapor.yml sets scheduler: false. Set PORRO_KEY in the environment's variables and deploy.

cPanel or Plesk

cPanel: Advanced → Cron Jobs. Plesk: Websites & Domains → Scheduled Tasks, as a Run a command task. Add:

* * * * * cd /home/account/example.com && php artisan schedule:run > /dev/null 2>&1

for Laravel, Filament or Statamic, or for Craft:

*/15 * * * * cd /home/account/example.com && php craft porro/report --scheduled > /dev/null 2>&1

Use the site's real folder, and the host's path to PHP if plain php isn't the version the site runs on. Your host's help pages list it, often as something like /usr/local/bin/php.

Any other server

As the site's user, run crontab -e and add the line for your site:

* * * * * cd /var/www/example.com/current && php artisan schedule:run > /dev/null 2>&1
*/15 * * * * cd /var/www/example.com/current && php craft porro/report --scheduled > /dev/null 2>&1

Drop /current if the site doesn't deploy into release folders.

Check it's running

Within 15 minutes of the job's first run, the site's page in Porro shows the scheduler as running. php artisan porro:status (php craft porro/status on Craft) shows whether the line is in the crontab and when the scheduler last ran.

Try it on your sites.

28 days free, no card needed. Import your sites from Forge, Laravel Cloud or Ploi in a couple of minutes.

Start your free trial →