Skip to content

A free open source IT asset/license management system

Change controller to assume a collection. (This is dumb, but whatever)

snipe7461c3e0ca2a
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'));
}
}