Skip to content

Tags: datpmwork/laravel-auth-queue

Tags

v1.1

Toggle v1.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #3 from datpmwork/1.x

Skips auth context restore for sync queues

v1.0

Toggle v1.0's commit message
Adds queueable authentication context

Implements a mechanism to preserve the authenticated user context when dispatching Laravel queued jobs, notifications, or event listeners.

This allows seamless access to the authenticated user who originally dispatched the job through Laravel's auth() manager when the job is being handled.

Includes:
- A trait `WasAuthenticated` to inject the authenticated context.
- A middleware to restore the authentication context when the job is handled.
- Tests to ensure the authentication context is preserved.