Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Quiz
- public function author()
- {
- return $this->belongsTo('App\User', 'created_by', 'id');
- }
- public function questions()
- {
- return $this->hasMany('App\Models\Question')->with('answers');
- }
- // Question
- public function answers()
- {
- return $this->hasMany('\App\Models\Answer');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement