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
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!