diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index abe09e8afa..896c253463 100755 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -194,14 +194,14 @@ class ProfileController extends Controller */ public function printInventory() : View { - $show_user = auth()->user(); + $show_users = User::where('id',auth()->user()->id)->get(); return view('users/print') - ->with('assets', auth()->user()->assets) - ->with('licenses', $show_user->licenses()->get()) - ->with('accessories', $show_user->accessories()->get()) - ->with('consumables', $show_user->consumables()->get()) - ->with('show_user', $show_user) + ->with('assets', auth()->user()->assets()) + ->with('licenses', auth()->user()->licenses()->get()) + ->with('accessories', auth()->user()->accessories()->get()) + ->with('consumables', auth()->user()->consumables()->get()) + ->with('users', $show_users) ->with('settings', Setting::getSettings()); } @@ -222,7 +222,12 @@ class ProfileController extends Controller return redirect()->back()->with('error', trans('admin/users/message.user_has_no_email')); } - $user->notify((new CurrentInventory($user))); + try { + $user->notify((new CurrentInventory($user))); + } catch (\Exception $e) { + \Log::error($e); + } + return redirect()->back()->with('success', trans('admin/users/general.user_notified')); } } diff --git a/resources/views/account/view-assets.blade.php b/resources/views/account/view-assets.blade.php index 96b95484a6..e4cb6d33f2 100755 --- a/resources/views/account/view-assets.blade.php +++ b/resources/views/account/view-assets.blade.php @@ -103,20 +103,23 @@ @can('self.profile')