Change method name from userloc to location

This needs to be changed in more places though
This commit is contained in:
snipe 2017-10-31 05:22:57 -07:00
parent f4e7bfc28d
commit 121e158f39
2 changed files with 11 additions and 1 deletions

View file

@ -53,7 +53,7 @@ class UsersController extends Controller
'users.activated',
'users.avatar',
])->with('manager', 'groups', 'userloc', 'company', 'department','throttle','assets','licenses','accessories','consumables')
])->with('manager', 'groups', 'location', 'company', 'department','throttle','assets','licenses','accessories','consumables')
->withCount('assets','licenses','accessories','consumables');
$users = Company::scopeCompanyables($users);

View file

@ -199,12 +199,22 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo
/**
* Get the asset's location based on the assigned user
* @todo - this should be removed once we're sure we've switched it
* to location()
**/
public function userloc()
{
return $this->belongsTo('\App\Models\Location', 'location_id')->withTrashed();
}
/**
* Get the asset's location based on the assigned user
**/
public function location()
{
return $this->belongsTo('\App\Models\Location', 'location_id')->withTrashed();
}
/**
* Get the user's manager based on the assigned user
**/