where("user_id", "=", Auth::user()->id)->get(); $visibleAccess = []; foreach($access as $a) { if(!$a->getApp()->hidden_in_app_list) { $visibleAccess[] = $a; } } return view("access/list", ["access" => $visibleAccess]); } public function removeAccess(Request $request) { if(!Auth::check()) { abort(401); } $access = AppAccess::query()->where("id", "=", $request->id)->firstOrFail(); if($access->user_id != Auth::user()->id) { abort(401); } RefreshToken::query()->where("access_id", "=", $access->id)->delete(); \App\Models\AccessToken::query()->where("access_id", "=", $access->id)->delete(); AppCode::query()->where("access_id", "=", $access->id)->delete(); $access->delete(); return redirect("/gui/access"); } }