model changes for accepted bids and contracts

This commit is contained in:
2019-04-26 02:56:34 -05:00
parent 791681034c
commit a977f36377
4 changed files with 23 additions and 10 deletions
+6 -2
View File
@@ -23,9 +23,13 @@ class Contract extends Model
'body',
];
protected $guarded = [];
//One-to-Many relationship for the bids on a contract
public function Bids() {
return $this->hasMany('App\Models\Contracts\Bid', 'contract_id', 'id');
}
//One-to-One relationship for the accepted bid.
public function AcceptedBid() {
return $this->hasOne('App\Models\Contracts\AcceptedBid', 'contract_id', 'id');
}
}