Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Fix configuration files merge #53452

Closed
wants to merge 2 commits into from
Closed

Conversation

erikn69
Copy link
Contributor

@erikn69 erikn69 commented Nov 8, 2024

Using array_merge is changing keys order,
Example auth.guards: https://onlinephp.io/c/4ad71

If you set a custom file, the laravel internal file change auth.guards order, this causes problems when upgrading from previous versions, with array union operator (+), the keys order is preserved

Is there a better solution?

Closes spatie/laravel-permission#2729

@taylorotwell
Copy link
Member

Why does the order of your guards matter? 👀

@erikn69
Copy link
Contributor Author

erikn69 commented Nov 9, 2024

Why does the order of your guards matter?

On spatie/laravel-permission, it tried to guess which is the most likely guard based on the model, if there is more than one guard for the same model, choose the first one, some people in previous versions used the order to locate the expected guard, but when migrating to Laravel 11 they encounter a breaking change

@donnysim
Copy link
Contributor

You can disable the merging dontMergeFrameworkConfiguration for the time being, you'll never notice or need it anyway.

@erikn69
Copy link
Contributor Author

erikn69 commented Nov 11, 2024

spatie/laravel-permission#2729 (comment)
Yes, If you read my comment, I said the same thing, but that part doesn't seem to be documented, and changing the order seems like a breaking change or at least an unexpected behavior

@taylorotwell
Copy link
Member

This could break existing applications on L11 though.

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.

Default auth guard is wrong for Laravel 11, config not updating
3 participants