diff --git a/stubs/app/Http/Controllers/ProfileController.php b/stubs/app/Http/Controllers/ProfileController.php index 95f2607..2f34447 100644 --- a/stubs/app/Http/Controllers/ProfileController.php +++ b/stubs/app/Http/Controllers/ProfileController.php @@ -22,7 +22,7 @@ public function editProfile(){ /** * Update the Avatar * - * @param Request + * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function updateAvatar(Request $request){ @@ -103,4 +103,16 @@ public function removeOldAvatar($internalRequest = false){ return \Redirect::back()->with('success', 'The avatar has been deleted successfully!'); } } -} \ No newline at end of file + + /** + * Remove unused device + * + * @param \Illuminate\Http\Request $request + * @param $id + * @return \Illuminate\Http\Response + */ + public function removeDevice(Request $request, $id){ + $delete = \DB::table('sessions')->where('id', $id)->delete(); + return \Redirect::back()->with('success', 'The device has been deleted successfully!'); + } +} diff --git a/stubs/resources/views/auth/login.blade.php b/stubs/resources/views/auth/login.blade.php index ae82cc9..d96761e 100644 --- a/stubs/resources/views/auth/login.blade.php +++ b/stubs/resources/views/auth/login.blade.php @@ -41,12 +41,12 @@ -
+ {{--
-
+
--}} diff --git a/stubs/resources/views/profile/edit.blade.php b/stubs/resources/views/profile/edit.blade.php index f771b92..c949145 100644 --- a/stubs/resources/views/profile/edit.blade.php +++ b/stubs/resources/views/profile/edit.blade.php @@ -102,7 +102,7 @@ class="avatar avatar-xl"> @if(\Session::getId() == $device->id) @else -
@csrf @method('DELETE') diff --git a/stubs/routes/web.php b/stubs/routes/web.php index b6fc264..b32c400 100644 --- a/stubs/routes/web.php +++ b/stubs/routes/web.php @@ -7,5 +7,5 @@ Route::get('/profile', [ProfileController::class, 'editProfile'])->name('profile'); Route::post('/profile/avatar', [ProfileController::class, 'updateAvatar'])->name('profile.avatar'); Route::delete('/profile/avatar', [ProfileController::class, 'removeOldAvatar'])->name('profile.deleteavatar'); - Route::delete('/profile/device', [ProfileController::class, ''])->name('profile.deletedevice'); + Route::delete('/profile/device/{id}', [ProfileController::class, 'removeDevice'])->name('profile.deletedevice'); }); \ No newline at end of file