laravel-auth-jobs-development

Installation
SKILL.md

Laravel Auth Jobs Development

Use this skill when a queued job must access the authenticated user that dispatched it. This package captures the authenticated user ID and guard during the HTTP request and restores that auth state inside queued jobs.

Install and Publish Configuration

composer require mrpunyapal/laravel-auth-jobs
php artisan vendor:publish --tag="auth-jobs-config"

Required Workflow

  1. Dispatch the job from a request handled by one of the middleware groups listed in config/auth-jobs.php.
  2. Let the package's AuthenticateJobs HTTP middleware store the authenticated user ID and guard in Laravel context for that request.
  3. Add new AuthenticateJob to the queued job's middleware() method so the auth state is restored before handle() runs.
  4. Read auth()->user() or run authorization checks inside handle() after the middleware has restored the auth state.
  5. If your application needs different context keys, replace context_keys with a custom class that implements HasContextKeys, or bind the interface in a service provider.
Installs
1
GitHub Stars
44
First Seen
Jun 22, 2026
laravel-auth-jobs-development — mrpunyapal/laravel-auth-jobs