added primary keys to all models

This commit is contained in:
2021-03-10 23:29:30 +09:00
parent 91bde37441
commit 4db6dac439
35 changed files with 197 additions and 19 deletions
+5 -2
View File
@@ -9,6 +9,9 @@ class SupplyChainBid extends Model
//Table Name
public $table = 'supply_chain_bids';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = true;
@@ -29,11 +32,11 @@ class SupplyChainBid extends Model
//Relationships
public function ContractId() {
return $this->hasOne('App\Models\Contracts\SupplyChainContract', 'contract_id', 'contract_id');
return $this->belongsTo(App\Models\Contracts\SupplyChainContract::class, 'contract_id', 'contract_id');
}
public function Contract() {
return $this->belongsTo(SupplyChainContract::class);
return $this->belongsTo(App\Models\Contracts\SupplyChainContract::class);
}
//Model functions