json([ 'allow_messages_from' => $request->user()->allow_messages_from ?? 'everyone', 'realtime_enabled' => $realtimeReady, ]); } public function update(Request $request): JsonResponse { $data = $request->validate([ 'allow_messages_from' => 'required|in:everyone,followers,mutual_followers,nobody', ]); $request->user()->update($data); return response()->json([ 'allow_messages_from' => $request->user()->allow_messages_from, 'realtime_enabled' => (bool) config('messaging.realtime', false), ]); } }