jandante's avatar

Where to put custom classes

Hi,

I'm storing my models in a MySQL database. One field of the model (Device) is a JSON field where all the settings will be stored. Not every instance of Device will have the same JSON structure and I want to create a class that is responsible of getting and setting properties in this JSON object. This class would have the responsibility to check if a (chain of) property exists and if so get or set it depending on the instruction.

My question is where should I put this kind of logic when following the Laravel way? The controller seems like a bad place to put his. And the Model would quickly become a very big file. Are there any lessons on Laracasts that may help me with this?

Thanks in advance!

0 likes
1 reply

Please or to participate in this conversation.