created relationships for public contract jobs and models

This commit is contained in:
2020-05-14 22:10:28 -05:00
parent 774d8b866e
commit 2a08fd71a2
4 changed files with 77 additions and 0 deletions
@@ -35,4 +35,8 @@ class PublicContract extends Model
'type',
'volume',
];
public function items() {
return $this->hasMany('App\Models\PublicContracts\PublicContractItem', 'contract_id', 'contract_id');
}
}
@@ -18,6 +18,7 @@ class PublicContractItem extends Model
* @var array
*/
protected $fillable = [
'contract_id',
'is_blueprint_copy',
'is_included',
'item_id',
@@ -28,4 +29,8 @@ class PublicContractItem extends Model
'time_efficiency',
'type_id',
];
public function contract() {
return $this->hasOne('App\Models\PublicContracts\PublicContract', 'contract_id', 'contract_id');
}
}