Skip to content

Conversation

@jradtilbrook
Copy link
Member

This propagates the Laravel Context through with Schedule Tasks so they carry the same contextual information from the schedule definition. Similar to how jobs, dispatched from requests or other jobs or commands carry the context from those entrypoints, this follows suit with schedule tasks.

@github-actions
Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@rodrigopedra
Copy link
Contributor

Where would one add anything to the context when scheduling tasks?

On the ./routes/console.php file? Outside any Artisan::command() calls?

If so, wouldn't those commands (to add things into the context) be executed on every HTTP request, as the console commands are parsed to be avaiable using Artisan::call()?

@jradtilbrook
Copy link
Member Author

@rodrigopedra good question, you may set some context in service providers, or in the before hook on the schedule task itself. Ie I want to use this functionality within Nightwatch to share sample rate and tracing

@jradtilbrook jradtilbrook marked this pull request as ready for review November 26, 2025 06:26
@rodrigopedra
Copy link
Contributor

Haven't thought of those places. I was curious about how to do it.

Thanks for the heads-up =)

@taylorotwell taylorotwell merged commit e17bf44 into laravel:12.x Nov 26, 2025
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants