LeafCMS GitHub Install
Docs

The in-app guide

This is the same guide as Admin → Help: usage, each admin screen, themes, tags, environment, and install.

Schedule and queues

Collectors and analytics prune do not run by themselves — the OS must wake Laravel every minute. PHP / nginx: Environment. Sources are in Collectors; each one only fetches when its interval is due.

What the scheduler does

JobWhenNotes
CollectEvery minuteEach source uses its own interval
Analytics prune03:20 dailyDeletes hits older than 90 days by default

php artisan serve or Docker for trying things out can skip this. A live site needs at least the cron line below, or collection only runs from the “Collect now” button.

Modes

CMS_COLLECT_MODEBehaviorExtra process
schedule (default)Fetch in the scheduler processOnly cron schedule:run every minute
queueScheduler only enqueues jobscron + a long-running queue:work
offNo automatic runsAdmin button or a manual command

CMS_STAT_PRUNE_MODE uses the same three values. After editing .env, run php artisan config:clear.

Recommended live minimum

CMS_SCHEDULE_ENABLED=true
CMS_COLLECT_MODE=schedule
CMS_STAT_PRUNE_MODE=schedule
* * * * * cd /var/www/leafcms && php artisan schedule:run >> /dev/null 2>&1

Replace the path with your project root. Linux: crontab. Windows: Task Scheduler, the same php artisan schedule:run every minute.

Queue for large collects

CMS_SCHEDULE_ENABLED=true
CMS_COLLECT_MODE=queue
CMS_COLLECT_QUEUE=cms
CMS_STAT_PRUNE_MODE=queue
CMS_STAT_PRUNE_QUEUE=cms
QUEUE_CONNECTION=database

Do not use QUEUE_CONNECTION=sync or it still runs inline. Use database or Redis.

* * * * * cd /var/www/leafcms && php artisan schedule:run >> /dev/null 2>&1
php artisan queue:work --queue=cms --sleep=1 --tries=1

The second line must stay up (systemd / supervisor). If it dies, collect and prune stop.

Your own cron, no Laravel scheduler

CMS_SCHEDULE_ENABLED=false
* * * * * cd /var/www/leafcms && php artisan cms:collect --sync
20 3 * * * cd /var/www/leafcms && php artisan cms:stat-prune --days=90 --sync

Queue mode: replace --sync with --queue and keep queue:work --queue=cms.

Manual commands

php artisan cms:collect
php artisan cms:collect --force
php artisan cms:collect --id=1 --force
php artisan cms:collect --queue
php artisan cms:collect --sync
php artisan cms:stat-prune --days=90

Docker: docker compose exec app php artisan cms:collect. Demo setups usually skip cron.

Group @sanpang