model changes for accepted bids and contracts
This commit is contained in:
@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class AcceptedBid extends Model
|
||||
{
|
||||
// Table Name
|
||||
public $table = 'accepted_bid';
|
||||
public $table = 'accepted_bids';
|
||||
|
||||
//Timestamps
|
||||
public $timestamps = true;
|
||||
@@ -20,6 +20,10 @@ class AcceptedBid extends Model
|
||||
protected $fillable = [
|
||||
'contract_id',
|
||||
'bid_id',
|
||||
'amount',
|
||||
'bid_amount',
|
||||
];
|
||||
|
||||
public function Contract() {
|
||||
return $this->belongsTo(Contract::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user