validate([ 'icon' => 'nullable|string|max:64', 'color' => 'nullable|string|max:32', ]); $server = Server::where('id', $serverId) ->where('user_id', Auth::id()) ->firstOrFail(); $server->user_set_icon = $request->input('icon'); $server->user_set_icon_color = $request->input('color'); $server->save(); return response()->json(['success' => true]); } // Get the icon and color for a server public function show($serverId) { $server = Server::where('id', $serverId) ->where('user_id', Auth::id()) ->firstOrFail(); return response()->json([ 'icon' => $server->user_set_icon, 'color' => $server->user_set_icon_color, ]); } }