Show awards on user profile #703 (#866)

This commit is contained in:
Nabeel S
2020-10-11 16:06:09 -04:00
committed by GitHub
parent 151f188886
commit 193fbd369d
16 changed files with 172 additions and 62 deletions

View File

@@ -208,9 +208,12 @@ class User extends Authenticatable
return $this->belongsTo(Airline::class, 'airline_id');
}
/**
* @return \App\Models\Award[]|mixed
*/
public function awards()
{
return $this->hasMany(UserAward::class, 'user_id');
return $this->belongsToMany(Award::class, 'user_awards');
}
/**