ensurePlatformEnabled(); $workspace = $request->user()->currentWorkspace; if (! $workspace) { return redirect()->route('workspaces.create'); } $this->authorize('manageAccounts', $workspace); $existingAccount = $workspace->socialAccounts() ->where('platform', $this->platform->value) ->first(); if ($existingAccount && ! $existingAccount->isDisconnected()) { session()->flash('flash.banner', __('accounts.flash.already_connected')); session()->flash('flash.bannerStyle', 'danger'); return back(); } return $this->redirectToProvider($request, $this->driver, $this->scopes); } public function callback(Request $request): View { return $this->handleCallback($request, $this->platform, $this->driver); } }