vendredi 30 janvier 2015

Which is better in Laravel - use Input::get() in Controller or Model?


Vote count:

0




I wanted to ask, looking from the 'best practices' side, which solution is better, getting a form data in Controller and passing it to Model, or retrieving it directly in the Model?


I use the first solution, which makes your controller methods very long and ugly, but I think it is still the right choice. But recently I have seen some other projects source code where the form data is retrieved in model, but it seems that it breaks the rule, where the model should not know, where the data comes from.


So which is the better practice?



asked 2 mins ago







Which is better in Laravel - use Input::get() in Controller or Model?

Aucun commentaire:

Enregistrer un commentaire