filled('network')) { $query->where('network', $request->string('network')); } if ($request->filled('type')) { $query->where('type', $request->string('type')); } return SocialAccountResource::collection($query->orderBy('username')->get()); } public function show(SocialAccount $socialAccount) { return new SocialAccountResource($socialAccount); } }