Skip to content

Conversation

@onlime
Copy link
Contributor

@onlime onlime commented Dec 11, 2024

as discussed in #10, Laravel is sometimes bootstrapped twice during the same request cycle. This happens e.g. in php artisan config:cache or php artisan route:cache. We should not log any warnings when trying to re-register macros in CorrelationIdServiceProvider, just silently ignore.

…d be bootstrapped twice (e.g. on `php artisan config:cache`)
@onlime
Copy link
Contributor Author

onlime commented Dec 13, 2024

@bilfeldt please merge it. I've discussed it with @pascalbaljet. There doesn't seem to be a "clean" way of warning the user about macro naming conflicts, while the framework boots twice under normal conditions. Using macros in a package could be considered as "risky" anyway, but I understand you're doing it like this, as bilfeldt/laravel-correlation-id Request macros are used as helpers in multiple other packages.

@bilfeldt bilfeldt merged commit a4d9c1a into bilfeldt:main Jan 20, 2025
13 checks passed
@bilfeldt
Copy link
Owner

Thanks for the PR 👍

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.

2 participants