Cron Jobs & Queue Workers
FeedbackPulse SaaS uses Laravel's task scheduler for automated background work. Setting up the مهمة cron is essential for full functionality.
The Cron Job (Required)
What It Does
The مهمة cron runs Laravel's scheduler every minute. The scheduler then decides which tasks to execute based on their configured frequency:
| Task | Frequency | What It Does |
|---|---|---|
feedbackpulse:trial-expiry | Every 6 hours | Restricts tenants whose free trial has ended without a paid plan |
feedbackpulse:usage-alerts | Daily at 9:00 AM | Sends email alerts to tenants approaching their plan's submission limit (90%+) |
data:enforce-retention | Daily at 2:00 AM | Deletes or anonymizes old submissions per الاحتفاظ بالبيانات policy |
digest:send | Daily at 8:00 AM | Sends daily/weekly ملخص البريد الإلكترونيs to tenant admins |
reports:send-scheduled | Daily at 7:00 AM | Sends تقارير مجدولة (daily/weekly/monthly) |
ai:detect-anomalies | Every 12 hours | AI-powered detection of unusual rating patterns |
Setting It Up
# Open the crontab editor
crontab -e
Add this single line:
* * * * * cd /var/www/feedbackpulse-saas && php artisan schedule:run >> /dev/null 2>&1
Explanation:
* * * * *— run every minutecd /var/www/feedbackpulse-saas— navigate to your projectphp artisan schedule:run— Laravel checks which tasks are due>> /dev/null 2>&1— discard output (logs go to Laravel's log file)
Verify It's Running
# List cron jobs
crontab -l
# Run manually to test
cd /var/www/feedbackpulse-saas
php artisan schedule:run
# Check the cron logs in the database (admin panel -> Settings)
cPanel Cron Setup
If you're on الاستضافة المشتركة with cPanel:
- اذهب إلى cPanel → Cron Jobs
- Set "Common الإعدادات" to Once Per Minute
- In the "Command" field, enter:
cd /home/username/feedbackpulse-saas && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1
ملاحظة: On cPanel, the PHP binary path might be
/usr/local/bin/phpor/usr/bin/php. Check withwhich php.