0

I'm planning out a web application using Laravel for the server side structure. The main goal of the application is to display a form that will allow the user to enter in Parent/Guardian and related Student information. The additional goals will be to allow administrators to log in and look up Parent/Guardian and Student data that has been submitted.

At the simplest, I feel like I could do this by using one controller for "Form" that facilitates the display of the form, the submission of the form data, and the showing of the stored data.

Thinking forward though, it seems like it would be beneficial to have the logic for the Parent/Guardians and the Students in separate resourceful controllers to make it easier/clearer to access and work with the logic per entity. If I did it this way though, it seems like I would need a third controller for the Form that would then call out to methods in the Parent/Guardian and Student controllers separately.

What would be the best way of approaching this structure? I want to go for the "pass the salt" or "just program what you need now" approach, but I know that I'll need more refined access to Parent/Guardians and Student data in the near future. My goal is to minimize the amount of refactoring by planning well at the beginning.

Any suggestions or insight would be appreciated.

Thanks!

tereško
  • 58,060
  • 25
  • 98
  • 150
Chris Schmitz
  • 20,160
  • 30
  • 81
  • 137
  • If you did enough laravel programming already, you should be able to think it through really easily. If you didnt, than you will be refactorting anyway. – peter.babic Aug 03 '14 at 10:08
  • My issue isn't thinking through it. I can see how I would build it either way. I'm asking the question to get a perspective from someone who's used laravel longer than I have as to which they would do and why. That's why I tagged it as "project-planning". I'm still relatively new to the framework so some advice on how to think when planning it out initially would be helpful. – Chris Schmitz Aug 03 '14 at 14:13
  • Watch Laracasts then. – peter.babic Aug 03 '14 at 16:40
  • Is there a particular laracast video you're thinking of our are you just trying to make me feel bad for asking a question? – Chris Schmitz Aug 03 '14 at 18:31
  • What? No. I am saying that you will be refactoring **anyway**, no matter what and the best way how to reduce it from the start is by learning the good practices from Laracasts. Your question seems too broad for me. – peter.babic Aug 03 '14 at 18:55
  • Gotcha, there are just literally hundreds of videos on laracast (I've watched quite a few) so saying "watch laracasts then" sounded like a brush off. Yeah, I count on having to refactor over time so it's not like I'm trying to avoid it, I was just looking for a general "this is probably the way you should try first" direction point. – Chris Schmitz Aug 03 '14 at 19:11
  • You probably wont receive a better answer, since your question is too broad. – peter.babic Aug 03 '14 at 19:18

0 Answers0