@extends('layouts.app') @section('title', 'Background Jobs') @section('content') @include('partials.flash') {{-- Worker status --}} @if($stats['waiting'] > 0)
warning

Jobs are waiting — is the queue worker running?

{{ $stats['waiting'] }} {{ Str::plural('job', $stats['waiting']) }} have been waiting over 2 minutes. Start a worker with php artisan queue:work to process them.

@else
bolt

Queue looks healthy

No jobs are stuck waiting. Emails and other background work are processed by php artisan queue:work.

@endif {{-- Course-due reminders --}} @isset($reminder)
notifications_active

Course-due reminders

Automatically email learners whose assigned courses are due soon (or already overdue). Runs daily and can be sent on demand. Right now {{ $reminder['due_count'] }} {{ Str::plural('enrolment', $reminder['due_count']) }} {{ $reminder['due_count'] === 1 ? 'is' : 'are' }} within the current window.

@unless($reminder['email_on'])

info Email is turned off in Settings — reminders will queue but won't be emailed until you enable it.

@endunless
@csrf
days
@error('reminder_due_days')

{{ $message }}

@enderror
@csrf
@csrf
Reminders are throttled — a learner isn't emailed about the same course more than once every 3 days, or about training risk more than once a week.
{{-- Scheduler requirement note --}}
schedule

Daily sending needs the scheduler running

The Send automatically (daily) option only fires if your server runs Laravel’s scheduler. Add this one cron entry on the server:

* * * * * cd {{ base_path() }} && php artisan schedule:run >> /dev/null 2>&1

Without it, the daily run won’t fire — but Send reminders now works anytime. Both also need a queue worker (php artisan queue:work) to actually deliver the emails.

@endisset {{-- Stat tiles --}}
@php $tiles = [ ['label' => 'Pending', 'value' => $stats['pending'], 'icon' => 'pending', 'tone' => 'text-primary'], ['label' => 'Waiting > 2 min', 'value' => $stats['waiting'], 'icon' => 'hourglass_top', 'tone' => $stats['waiting'] ? 'text-error' : 'text-outline'], ['label' => 'Failed', 'value' => $stats['failed'], 'icon' => 'error', 'tone' => $stats['failed'] ? 'text-error' : 'text-outline'], ]; @endphp @foreach($tiles as $t)
{{ $t['icon'] }}

{{ $t['value'] }}

{{ $t['label'] }}

@endforeach
{{-- Pending jobs --}}
schedule

Pending jobs

({{ $stats['pending'] }})
@forelse($pending as $job) @empty @endforelse
Job Queue Attempts Status Queued
{{ $job['name'] }} {{ $job['queue'] }} {{ $job['attempts'] }} @if($job['reserved']) autorenew Processing @else schedule Waiting @endif {{ $job['created_at']->diffForHumans() }}
No pending jobs — the queue is clear.
{{-- Failed jobs --}}
{{ $stats['failed'] ? 'error' : 'check_circle' }}

Failed jobs

({{ $stats['failed'] }})
@if($stats['failed'] > 0)
@csrf
@csrf
@endif
@forelse($failed as $job) @empty @endforelse
Job Error Failed Actions

{{ $job['name'] }}

{{ $job['queue'] }}

{{ $job['error'] }} {{ $job['failed_at']->diffForHumans() }}
@csrf
@csrf @method('DELETE')
No failed jobs — nothing to worry about.
@endsection