Hasnayeen / themes

Themes for Filament panels.
MIT License
217 stars 30 forks source link

Fix duplication for Octane #51

Closed thethunderturner closed 5 months ago

thethunderturner commented 5 months ago

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!

Hasnayeen commented 5 months ago

@thethunderturner thanks for the PR :+1:

thethunderturner commented 5 months ago

@thethunderturner thanks for the PR 👍

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