workspace->socialAccounts()->orderBy('platform')->get(); return SocialAccountResource::collection($accounts); } public function toggle(Request $request, SocialAccount $account): SocialAccountResource|JsonResponse { if ($account->workspace_id !== $request->workspace->id) { return response()->json( ['message' => 'Account not found.'], Response::HTTP_NOT_FOUND, ); } ToggleSocialAccount::execute($account); return new SocialAccountResource($account); } }