client()->service()->statement( $request->only(['start_date', 'end_date', 'show_payments_table', 'show_aging_table', 'status']) ); if ($pdf) { return response()->streamDownload(function () use ($pdf) { echo $pdf; }, ctrans('texts.statement') . '.pdf', ['Content-Type' => 'application/pdf']); } return response()->json(['message' => 'Something went wrong. Please check logs.']); } }