mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Added assets relationship
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
a5ff623484
commit
eb5d93b3c2
|
@ -75,4 +75,17 @@ class Depreciation extends SnipeModel
|
||||||
{
|
{
|
||||||
return $this->hasMany(\App\Models\License::class, 'depreciation_id');
|
return $this->hasMany(\App\Models\License::class, 'depreciation_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Establishes the depreciation -> assets relationship
|
||||||
|
*
|
||||||
|
* @author A. Gianotto <snipe@snipe.net>
|
||||||
|
* @since [v5.0]
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\Relation
|
||||||
|
*/
|
||||||
|
public function assets()
|
||||||
|
{
|
||||||
|
return $this->hasManyThrough(\App\Models\Asset::class, \App\Models\AssetModel::class, 'depreciation_id', 'model_id');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue