orderByRequest($contact, $request); $this->searchRequest( builder: $contact, value: $request->get('search'), fields: [ 'name', 'phone', 'company', 'email', ] ); $responseData = array_merge( $contact->paginate($request->get('per_page'))->toArray(), ['status' => true] ); return response()->json($responseData); } }