Helper methods for license view display
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user