I'm new in Laravel (and in frameworks general) and not sure about the right "place" for a formatting function.
A short desciption of my problem: Different tables refer to an enumeration table. The enumeration table keeps a link to an icon, a color, a name and a describtion. I need to format this information in different ways. e.g. "simple" name "detailed" name, description etc...
Now I'm not sure what's best place to put the code:
- create a custom helper seems to be a too generic place for such issue
- putting in in the model would be the easiest way but seems to me violaton of MVC.
- the view violates the "don't repeat yourself" because I need it in different views
- the template itself? maybe..
- or create a dedicated blade like phpincludes.enumerationfomat ?
Thanks in advance, Christian
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire