Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. // Quiz    
  2.     public function author()
  3.     {
  4.         return $this->belongsTo('App\User', 'created_by', 'id');
  5.     }
  6.  
  7.     public function questions()
  8.     {
  9.         return $this->hasMany('App\Models\Question')->with('answers');
  10.     }
  11. // Question
  12.     public function answers()
  13.     {
  14.         return $this->hasMany('\App\Models\Answer');
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement