Console Commands
JournalPHP uses Artisan — Laravel's standard CLI.
Running Commands
Dev environment:
bash
docker compose exec app php artisan <command>Production:
bash
docker compose -f docker-compose.prod.yml exec app php artisan <command>JournalPHP Commands
Located in app/Console/Commands/. Can be run manually or on a schedule via Laravel Scheduler.
Users
| Signature | Purpose |
|---|---|
users:unban | Remove temporary bans that have expired |
users:purge-deleted | Permanently delete soft-deleted accounts |
Rating
| Signature | Purpose |
|---|---|
rating:update-place-history | Recalculate and store user rating place history |
Subscriptions
| Signature | Purpose |
|---|---|
subscriptions:payments:check-pending | Check pending payments and dispatch queue jobs |
subscriptions:auto-renew | Run auto-renewal cycle for subscriptions |
Options for subscriptions:payments:check-pending:
| Option | Default | Purpose |
|---|---|---|
--queue=subscription-payments | subscription-payments | Queue for background payment processing |
--minutes=10 | 10 | How many minutes back to look for pending payments |
Content
| Signature | Purpose |
|---|---|
post-counts:refresh | Recalculate denormalized post counters |
topics:update-activity-score | Update community activity scores (7-day window) |
Media
| Signature | Purpose |
|---|---|
media:cleanup-orphaned {--limit=500} | Delete media files not attached to any entity |
Moderation
| Signature | Purpose |
|---|---|
moderation:comments {--sync} | Run AI moderation on queued comments |
Standard Laravel Commands
Database
bash
php artisan migrate --force
php artisan migrate:status
php artisan db:seed
php artisan migrate:rollbackCache
bash
php artisan optimize:clear
php artisan cache:clear
php artisan route:cache
php artisan view:cache
php artisan config:cacheApplication
bash
php artisan key:generate
php artisan storage:link
php artisan aboutQueues & WebSocket
bash
php artisan horizon
php artisan reverb:start
php artisan queue:work
php artisan queue:failed
php artisan queue:retry allSearch (Scout)
bash
php artisan scout:import "App\Models\Post"
php artisan scout:flush "App\Models\Post"Interactive Shell
bash
docker compose exec app php artisan tinkerAllows running PHP code in the application context — useful for debugging and manual data operations.
List All Commands
bash
docker compose exec app php artisan listScheduler
Automatic command scheduling is configured in app/Console/Kernel.php. Current schedule:
| Command | Interval |
|---|---|
users:unban | hourly |
rating:update-place-history | every minute |
subscriptions:payments:check-pending | every minute |
subscriptions:auto-renew | hourly |
users:purge-deleted | hourly |
media:cleanup-orphaned | every 30 minutes |
topics:update-activity-score | twice daily |
moderation:comments | every minute |
For production scheduling, add a cron entry:
bash
* * * * * docker exec <container_name> php artisan schedule:run >> /dev/null 2>&1Or via Docker:
bash
docker compose exec app php artisan schedule:runThe routes/console.php file is only used to register Artisan closure commands, not the schedule.