Skip to content

Console commands ​

JournalPHP console commands run the platform's background tasks; most of them are started by the scheduler automatically.

Overview ​

JournalPHP uses Artisan, the Laravel console. Commands run inside the app container:

bash
# local environment
docker compose exec app php artisan <command>

# production
docker compose -f docker-compose.prod.yml exec app php artisan <command>

JournalPHP commands ​

CommandPurpose
users:unbanDeletes expired bans: platform bans and topic bans
users:purge-deletedPermanently deletes accounts whose recovery period has ended
rating:update-place-historyQueues recalculation of places in the author rating
rating:save-monthly-places {--month=}Saves the final places of the monthly top authors and top commenters. Previous month by default, --month=2026-08 for a given month
achievements:award {--full}Awards achievements to users with new activity since the last run. With --full checks all users and all rules
topics:update-activity-scoreRecalculates topic activity over 7 days
post-counts:refreshRecalculates the counters of all posts
media:cleanup-orphaned {--limit=500}Deletes files uploaded more than 30 minutes ago and not attached to a post, comment or other record
moderation:comments {--sync}Runs AI moderation of the next batch of unreviewed comments. With --sync runs immediately, without the queue
subscriptions:payments:check-pending {--minutes=10} {--queue=subscription-payments}Queues status checks of pending payments updated in the last --minutes minutes
subscriptions:auto-renewStarts auto-renewal of subscriptions that expired in the previous hour
notifications:reactions-digestSends emails with the reactions summary for the previous hour
notifications:daily-digestSends the "Interesting of the day" email
notifications:blog-statsSends blog statistics for 7 days

Schedule ​

CommandFrequency
rating:update-place-historyevery minute
subscriptions:payments:check-pendingevery minute
moderation:commentsevery minute
media:cleanup-orphanedevery 30 minutes
users:unbanhourly
users:purge-deletedhourly
subscriptions:auto-renewhourly
achievements:awardhourly
notifications:reactions-digesthourly at :05
topics:update-activity-scoretwice a day
achievements:award --fulldaily at 03:30
notifications:daily-digestdaily at 09:00
notifications:blog-statsMondays at 10:00
rating:save-monthly-placeson the 1st of each month at 00:10

The schedule is printed by:

bash
php artisan schedule:list

Laravel commands ​

Database ​

bash
php artisan migrate --force        # run migrations
php artisan migrate:status         # migration status

Cache ​

bash
php artisan optimize:clear         # clear all caches

Queues ​

bash
php artisan horizon:status         # Horizon status
php artisan horizon:terminate      # restart workers, Supervisor brings them back up
php artisan queue:failed           # failed jobs
php artisan queue:retry all        # retry failed jobs
bash
php artisan scout:import "App\Models\Post"
php artisan scout:import "App\Models\User"
php artisan scout:flush "App\Models\Post"

The index can also be synchronized from the admin panel; see Search.

Other ​

bash
php artisan about                  # environment summary
php artisan tinker                 # interactive console
php artisan list                   # list all commands

Released under the MIT License.