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

Fix duplication for Octane #51

Merged
merged 2 commits into from
Apr 10, 2024
Merged

Fix duplication for Octane #51

merged 2 commits into from
Apr 10, 2024

Conversation

thethunderturner
Copy link
Contributor

Fixes Octane duplication issue
#47

Explanation

Laravel Octane keeps the application instance alive across requests, which can lead to issues where stateful operations (like adding menu items) are repeated unintentionally. However, the way PHP arrays handle keys ensures that you can't accidentally add two items with the same key to an associative array.

This solution checks if the themes menu item is already in the user menu items. If its not (then its not set). we add the themes menu item, otherwise we skip it!

Fixes Octane duplication issue
Better approach! Dont even add if its already there
@Hasnayeen Hasnayeen merged commit 2f01784 into Hasnayeen:3.x Apr 10, 2024
1 check passed
@Hasnayeen
Copy link
Owner

@thethunderturner thanks for the PR 👍

@thethunderturner
Copy link
Contributor Author

@thethunderturner thanks for the PR 👍

You're welcome :)! Also please close the issue #47 and release a new tag.

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.

None yet

2 participants