Background-job-runner/ ├── app/ │ ├── Jobs/ │ │ ├── MyJob.php # Sample job that executes successfully (may chain to another job) │ │ ├── FailingJob.php # Sample job that always throws an exception for testing retry logic │ │ └── AnotherJob.php # Sample chained job (triggered via MyJob's nextJob() method) │ └── Helpers/ │ └── helpers.php # Contains the global helper function runBackgroundJob() ├── config/ │ └── background-jobs.php # Defines allowed job classes, allowed methods, retry attempts, and delays ├── public/ ├── resources/ │ └── views/ │ └── jobs_dashboard.blade.php # Web dashboard to display job logs and manage active jobs ├── routes/ │ └── web.php # Routes for the dashboard and job cancellation ├── storage/ │ └── logs/ │ ├── background_jobs.log # Stores log messages for job execution │ ├── background_jobs_errors.log # Stores log messages for job errors │ └── active_jobs.json # Tracks currently active jobs (for cancellation) ├── run-job.php # CLI script to execute jobs (with retry logic, logging, and chained jobs) ├── cancel-job.php # (Optional) CLI tool to cancel a job using its unique job ID ├── README.md # Project documentation (this file) └── composer.json # Composer configuration and autoload settings.