{{ __('Automation mode') }}
{{ __('Choose how background tasks run. You can change this at any time.') }}
{{ __('Setup guide') }}
{{-- Callout: 1 command = the whole cron suite other panel scripts require --}}{{ __('No configuration needed') }}
{{ __('Your panel is using automatic middleware mode. Background tasks run on every web request — no cron job or worker process required. Just use your panel normally.') }}
{{ __('If you want more reliable task scheduling (especially on low-traffic sites), switch to "Cron scheduler" above and follow the cPanel setup guide.') }}
@endif {{-- SCHEDULER: show cPanel guide + individual commands --}} @if($mode === 'scheduler'){{ __('Add these cron entries to your hosting control panel (cPanel → Advanced → Cron Jobs). The first command runs every minute and handles all order processing. The second runs hourly for billing.') }}
{{-- Equivalence table for operators migrating from other SMM panel scripts --}}| {{ __('Typical panel cron') }} | {{ __('Built-in equivalent') }} | {{ __('Frequency') }} |
|---|---|---|
| cron/order | DispatchOrderJob | {{ __('Every minute') }} |
| cron/status | PollOrderStatusJob | {{ __('Every minute') }} |
| cron/sync_services | SyncCatalogJob | {{ __('Configurable (default 1 h)') }} |
| cron/dripfeed | DripFeedTickJob | {{ __('Every minute') }} |
| cron/refill_status | PollRefillJob | {{ __('Every minute') }} |
| cron/status_subscriptions | {{ __('SMM Subscriptions') }} | {{ __('v1.1 (coming soon)') }} |
{{ $entry['command'] }}
{{ __('The commands above use `php` which works on most hosts. If your cron does not execute, replace `php` with the full path to PHP 8.2+ on your server:') }}
{{ $alt }}
{{ __('Ask your hosting support "What is the full path to PHP 8.2 CLI on this server?" if none of the above work.') }}
{{ __('Run a persistent worker process on your VPS or dedicated server. Background jobs are queued and processed asynchronously for best performance.') }}
{{-- Step 1: queue worker --}}{{ __('Step 1 — Start the queue worker (keep it running with Supervisor or systemd):') }}
{{ $workerCmd }}
{{ __('Step 2 — Add these cron entries (they enqueue work for the worker above):') }}
{{ $entry['command'] }}
{{ __('Create') }} /etc/supervisor/conf.d/redfamosa-worker.conf:
[program:redfamosa-worker]
command={{ $workerCmd }}
autostart=true
autorestart=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/var/log/redfamosa-worker.log
{{ __('Then run:') }} sudo supervisorctl reread && sudo supervisorctl update && sudo supervisorctl start redfamosa-worker:*
{{ __('How orders are pushed to providers') }}
@php $steps = [ ['color'=>'#6366f1', 'title'=>__('Client places order'), 'desc'=>__('Order created with status Awaiting. Charge debited from wallet immediately and atomically.')], ['color'=>'#f59e0b', 'title'=>__('DispatchOrderJob fires'), 'desc'=>__('Picks up Awaiting orders (25 per provider). Calls provider API (action=add, url, quantity). Serialized per provider — no concurrent calls to the same upstream.')], ['color'=>'#10b981', 'title'=>__('Provider returns order ID'), 'desc'=>__('Status → Pending. provider_order_id saved. next_poll_at set to ~60 s. If the API rejects → status Error. Orders are NEVER faked as Completed.')], ['color'=>'#3b82f6', 'title'=>__('PollOrderStatusJob fires'), 'desc'=>__('Sends multiStatus (up to 100 IDs) in one API call. Applies real status: Completed, Partial (proportional refund), Canceled (full refund). next_poll_at staggered 60–300 s to avoid rate limits.')], ['color'=>'#ec4899', 'title'=>__('Refunds on Partial / Canceled'),'desc'=>__('refund = charge × (undelivered ÷ quantity). Dual-wallet (reseller) orders unwind both sides atomically. Ledger is immutable — entries are appended, never edited.')], ['color'=>'#8b5cf6', 'title'=>__('Drip-feed (optional)'), 'desc'=>__('DripFeedTickJob emits sub-orders at the configured interval until the full quantity is done. Each sub-order goes through the same Dispatch → Poll cycle.')], ]; @endphp{{ $s['title'] }}
{{ $s['desc'] }}
{{ __('Last catalogue sync') }}
| {{ __('Task') }} | {{ __('Job class') }} | {{ __('Frequency') }} | {{ __('Last run') }} | {{ __('Action') }} |
|---|---|---|---|---|
|
{{ $t['label'] }} @if(!empty($t['coming_soon'])) {{ __('Coming v1.1') }} @endif{{ $t['description'] }} @endif |
{{ $t['job'] }} | {{ $t['cadence'] }} | @if ($t['last']) {{ \Illuminate\Support\Carbon::createFromTimestamp($t['last'])->diffForHumans() }} @else — @endif | @if(empty($t['coming_soon'])) @else — @endif |
{{ __('Periodic task intervals') }}
{{ __('How often each heavy task runs (in seconds). Minimum 60 s, maximum 86400 s (24 h). Changes take effect on the next tick.') }}
{{ __('Default 3600 = every 1 hour') }}
{{ __('Default 3600 = every 1 hour') }}
{{ __('Default 3600 = every 1 hour') }}