From 3595552f02ffd836fe1a56efdf1b41e659d535ca Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 11 Apr 2019 14:33:53 -0600 Subject: [PATCH] Update SecuritySettings, add devices to security view --- app/Http/Controllers/Settings/SecuritySettings.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Settings/SecuritySettings.php b/app/Http/Controllers/Settings/SecuritySettings.php index 01dc35384..8cb8261e7 100644 --- a/app/Http/Controllers/Settings/SecuritySettings.php +++ b/app/Http/Controllers/Settings/SecuritySettings.php @@ -8,6 +8,7 @@ use App\Media; use App\Profile; use App\User; use App\UserFilter; +use App\UserDevice; use App\Util\Lexer\PrettyNumber; use Auth; use DB; @@ -27,7 +28,12 @@ trait SecuritySettings ->limit(20) ->get(); - return view('settings.security', compact('activity', 'user')); + $devices = UserDevice::whereUserId($user->id) + ->orderBy('created_at', 'desc') + ->limit(5) + ->get(); + + return view('settings.security', compact('activity', 'user', 'devices')); } public function securityTwoFactorSetup(Request $request)