view flight bids in flights screen #203

This commit is contained in:
Nabeel Shahzad
2018-03-20 11:28:06 -05:00
parent 06e1cd15c0
commit 4e59bd0442
9 changed files with 69 additions and 25 deletions

View File

@@ -168,6 +168,18 @@ class User extends Authenticatable
return $this->belongsTo(Pirep::class, 'last_pirep_id');
}
/**
* These are the flights they've bid on
*/
public function flights()
{
return $this->belongsToMany(Flight::class, 'bids');
}
/**
* The bid rows
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function bids()
{
return $this->hasMany(Bid::class, 'user_id');