Lessons:24Length:2.5 hours
  • Overview
  • Transcript

3.3 Relate Questions to Users

Before we begin allowing users to ask questions it’s important that we setup the relationship between a question and a user. Laravel allows us to define these relationships in our models. Let’s use our question model and our user model to set up the “Question belongs to User” relationship and the “User has many Questions” relationship.