DEV Community

Discussion on: Laravel fit models.

Collapse
 
bakle profile image
bakle

I never talked about cleaning up code. This article refers to reduce a lot of methods in a model. It doesn't mean that we are cleaning up, as you say, we're just moving groups of methods to a specfic file, in this cases to traits to have a light or fit model that is easy to read.

Collapse
 
fireynis profile image
Jeremy MacArthur

But don't you have the same amount of methods but just spread over a few files?

Thread Thread
 
bakle profile image
bakle

Yes but not directly inside the model. That is why I refer to "reducing the number of methods within the model", this make the model itself easier to read. Extract methods into specific files is one of the principles of refactoring.