mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-13 15:01:02 -08:00
Added requests() method on Assets
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
3a37b80251
commit
08693f09b0
|
@ -786,7 +786,17 @@ class Asset extends Depreciable
|
||||||
return $this->belongsTo(\App\Models\Location::class, 'location_id');
|
return $this->belongsTo(\App\Models\Location::class, 'location_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Establishes the asset -> checkout_requests relationship
|
||||||
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
|
* @since [v6.2.4]
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\Relation
|
||||||
|
*/
|
||||||
|
public function requests()
|
||||||
|
{
|
||||||
|
return $this->belongsToMany(\App\Models\Asset::class, 'checkout_requests', 'requestable_id', 'user_id')->where('requestable_type','=',\App\Models\Asset::class);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the next autoincremented asset tag
|
* Get the next autoincremented asset tag
|
||||||
|
|
Loading…
Reference in a new issue