Moving routes inside plugin break the app
Hi, i'm experiencing a strange behaviour in my app
i have one custom plugin for the news mgmt
i moved my routes from the app to the plugin
1 Reply
as is, without modification
but i get an error not present before
i have a LocaleMenu controller in the app that serves for the menu translations
as you can see, this controller sets a pair of variable that i use in my view
but, after moving the news route, i get Undefined variable $mainMenuItems
because the localeMenu is not loaded at all
this controller is registered in bootstrap/app
all the cache are cleared
if i put back the rout in the main web.php
all works fine, plugin routes/web.php also work beacause i can put a debug here
after some researche, middleware are applied only if the routes are defined in the main route. to solve this i opted for a php code in the layout