Updated method for eager loading assets

This commit is contained in:
snipe 2017-02-21 15:39:59 -08:00
parent 2c6f323820
commit 53ba2bbb4e

View file

@ -552,7 +552,7 @@ class UsersController extends Controller
*/
public function show($userId = null)
{
if(!$user = User::with('assignedAssets', 'assignedAssets.model', 'consumables', 'accessories', 'licenses', 'userloc')->withTrashed()->find($userId)) {
if(!$user = User::with('assets', 'assets.model', 'consumables', 'accessories', 'licenses', 'userloc')->withTrashed()->find($userId)) {
$error = trans('admin/users/message.user_not_found', compact('id'));
// Redirect to the user management page
return redirect()->route('users.index')->with('error', $error);