title: laravel 5 OOP structure/architecture advice
body: <p>I have a general question about how to implement the best practice of model structure for an application I'm building in Laravel 5.</p>
  
  <p>So, at the moment I have things set up like this:</p>
  
  <p>'<strong>user</strong>' model and table: id, email, password, admin level - this is really just the info for authenticating login.</p>
  
  <p>'<strong>user-details</strong>' model and table: id, userID (foreign key for user table id field), name, address etc - all the other details </p>
  
  <p>'<strong>lesson-type</strong>' model and table: id, teacherID (foreign key for user-details table id field), lesson-label etc - info about different types of lessons </p>
  
  <p>At the moment I have a Teacher Controller in which I'm passing through to the view:
   - The info from the <strong>User</strong> table
   - The info from the <strong>User-details</strong> table
   - A list of different lesson types for the teacher from the <strong>Lesson-type table</strong></p>
  
  <p>But I kind of feel that all this should be tied together with one separate <strong>Teacher model</strong> which would extend the <strong>User-details</strong> model (and probably which in turn should extend the <strong>User</strong> model), but wouldn't have it's own table associated with it, but all the info pertaining to either updates for the User-details or the Lesson-types table would be stored in those relevant tables. Would this be correct?</p>
  
  <p>(I should also say that users may alternatively be parents rather than teachers, and so would I would have a separate <strong>Parents</strong> model for all the properties and so on associated with parents)</p>
  
  <p>I would then pass only the Teacher model object into the view and thus gain access to all the teacher info such as personal details and array of lesson types.</p>
  
  <p>As I'm typing, this is sounding more and more to me like the right way to go, but it would be great to get some advice.</p>
  
  <p>1 - technical implementation: I guess in the Teacher model, I'd populate all the relevant teacher into class variables (Name, array of lessons etc) in the constructor?</p>
  
  <p>2 - am I over complicating this structure by having both Users AND Users details tables?</p>
  
  <p>3 - Does what I'm proposing make the most structural sense in Laravel?</p>
  
  <p>4 - just another thought I've just had, should the teacherID in the lesson-type table actually refer to the User table rather than the User-detail table... so user-detail and lesson-type would both be direct children of the user table??</p>
  
  <p><strong>Very</strong> much obliged for any help :)</p>