Coincidentally, this question from earlier today should help
https://laracasts.com/discuss/channels/laravel/making-form-dropdown-dry-and-validate
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi I wanted to know what is the best way for static data and their use. For example, I have a series of categories that are fixed, as well as a fixed role. These values are set once in the program settings and are called in different places.I have a table like this: Id | key | value | options 1 | 'category' | 'cat1' | {'color':'red', 'is_default':false} 2 | 'role' | 'manager' | {'label' : 'Mgr'}
And use this data various places, like combobox selection and I save id of row to different table and retrive it many time, Now, given that these data are fixed, I do not want to invoke the database every time and I want to call once and use different places. Is this the right way?What is the best way to do this?
Coincidentally, this question from earlier today should help
https://laracasts.com/discuss/channels/laravel/making-form-dropdown-dry-and-validate
Please or to participate in this conversation.