Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User extends Authenticatable
- {
- public function address () {
- $this->hasOne(App\Address::class);
- }
- public function test()
- {
- return $this->hasMany(App\Test::class);
- }
- }
- class Test extends Model
- {
- public function user()
- {
- return $this->belongsTo(\App\User::class);
- }
- public function category()
- {
- return $this->hasOne(\App\Category::class);
- }
- public function question()
- {
- return $this->hasMany(\App\Question::class);
- }
- }
- class Question extends Model
- {
- public function test()
- {
- return $this->belongsTo(App\Test::class);
- }
- public function answer()
- {
- return $this->hasMany(App\Answer::class);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement