Got it
<component :dropdown="{{json_encode(config('custom.dropdown', true))}}"></component>
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all,
I have always created my dropdown menus within my HTML code, but with time, as the application is growing, I do find it a bit unmanageable.
What is the best way to build a constant of let's say 4 choices which I can pass to all my crude, so the day I have a 5th choice, I simply change the data within the constant. I am not sure where the constant should be, config file? If yes, how do you then deal with them in my vue files?
UPDATE Trying to pass a config to vue, cannot manage, nothing passes to the component:
<component :dropdown="{{json_encode(config('custom.dropdown'))}}"></component>
and in the component I receive it as a props.
Thank you.
Got it
<component :dropdown="{{json_encode(config('custom.dropdown', true))}}"></component>
Please or to participate in this conversation.