mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 22:37:28 -08:00
Updated method for eager loading assets
This commit is contained in:
parent
2c6f323820
commit
53ba2bbb4e
|
@ -552,7 +552,7 @@ class UsersController extends Controller
|
||||||
*/
|
*/
|
||||||
public function show($userId = null)
|
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'));
|
$error = trans('admin/users/message.user_not_found', compact('id'));
|
||||||
// Redirect to the user management page
|
// Redirect to the user management page
|
||||||
return redirect()->route('users.index')->with('error', $error);
|
return redirect()->route('users.index')->with('error', $error);
|
||||||
|
|
Loading…
Reference in a new issue