added primary keys to all models
This commit is contained in:
@@ -36,4 +36,8 @@ class Asset extends Model
|
||||
'type_id',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function structure() {
|
||||
return $this->belongsTo(App\Models\Structure\Structure::class, 'structure_id', 'location_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,6 @@ class Service extends Model
|
||||
];
|
||||
|
||||
public function structure() {
|
||||
return $this->hasOne('App\Models\Structure\Structure', 'structure_id', 'structure_id');
|
||||
return $this->belongsTo(App\Models\Structure\Structure::class, 'structure_id', 'structure_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,10 @@ class Structure extends Model
|
||||
];
|
||||
|
||||
public function services() {
|
||||
return $this->hasMany('App\Models\Structure\Service', 'structure_id', 'structure_id');
|
||||
return $this->hasMany(App\Models\Structure\Service::class, 'structure_id', 'structure_id');
|
||||
}
|
||||
|
||||
public function assets() {
|
||||
return $this->hasMany(App\Models\Structure\Asset::class, 'location_id', 'structure_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user