Helper methods for license view display

This commit is contained in:
snipe
2013-11-19 17:32:33 -05:00
parent 67aaeaf7f8
commit 7352eaec2e
+23
View File
@@ -21,6 +21,29 @@ class License extends Elegant {
return $this->belongsTo('User', 'assigned_to');
}
/**
* Get the asset's location based on the assigned user
**/
public function assetloc()
{
return $this->assigneduser->hasOne('Location');
}
/**
* Get action logs for this asset
*/
public function assetlog()
{
return $this->hasMany('Actionlog','asset_id')->orderBy('added_on', 'desc');
}
/**
* Get action logs for this asset
*/
public function adminuser()
{
return $this->belongsTo('User','id');
}
}