Back

Suggest me a process of creating Models.


Dear All,

I have learned all the required basics of Laravel and I'm confused at one thing. Is it okay if I create one module at a time. I would like to create a Model, Controller and required views. Once, the code is completed, I would move on to the next set of Model, Controller and View. Is this a good approach or should I create all the models, controllers and views at once. Please suggest me a good practice. Thank you.

Paolo Caleffi replied 1 week ago

If you are starting programming now, I can suggest you to read a bit about TDD (Test Driven Development) and follow that approach. If you do not want to produce automatic testing at first and add them later (and trust me, it's a pain in the a**), I think that the process which work better is doing all type of classes together (in this way you are focussed on one aspect at a time) with this suggested order: Migrations -> Models -> Factories -> Seeders -> Policies -> Requests -> Controllers -> Views.

While working on a certain kind of classes you'll still notice that you'll need to jump a lot to other kinds to fix some bugs or add methods, it's pretty normal in my experience.

Shiva Sheshendra replied 6 days ago

Thank you, Paolo Caleffi.


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us