Let's now switch back to Eloquent and begin discussing relationships. For example, if I have a $user
instance, how might I fetch all projects that were created by that user? Or if I instead have a $project
instance, how would I fetch the user who manages that project?
For a deeper dive, please review the Eloquent Relationships Laracasts series.
app/Models
directory. This means an App\Post
namespace should now be App\Models\Post
.