script-development/kendo-report-tool
Laravel package for creating Kendo UI reports from Eloquent queries. Define reusable report schemas, apply filters, and output JSON or Blade views for Kendo Report Viewer. Streamlines data preparation and printable report generation.
KendoReportToolServiceProvider; if package discovery is disabled, register the provider manually.config/report-tool.php first. The keys you will normally care about are kendo_url, project, token, connect_timeout, timeout, and swallow.REPORT_TOOL_*. At minimum set the Kendo URL, project, and a token with the report:create scope.swallow off by default. With it off, failures throw ReportSubmissionException; with it on, failures are logged to PHP error_log and submit() returns null.use KendoReports;
use KendoReportTool\Exceptions\ReportSubmissionException;
try {
$report = KendoReports::submit(
title: $request->string('title')->toString(),
description: $request->string('description')->toString(),
authorName: $request->user()?->name,
files: (array) $request->file('files', []),
);
// $report is the decoded 201 response body when submitted successfully.
return back()->with('status', $report ? 'Report submitted.' : 'Report could not be submitted.');
} catch (ReportSubmissionException $e) {
report($e);
return back()->withErrors('Report submission failed.');
}
submit() performs a blocking HTTP call, dispatch a job when the report is not part of the immediate user response. Let exceptions bubble in the job when swallow is false so Laravel’s queue retry/backoff can apply.null as “submission did not succeed,” never as success. null only appears when report-tool.swallow is enabled. If you enable swallow, log and monitor the PHP error_log, because the package does not throw.UploadedFile instances or local file paths. Pass request uploads directly, or pass readable local paths for generated reports/screenshots. Validate file type and size in your own request/job before calling the client.null authorName is omitted from the multipart payload, so anonymous/internal submissions do not need a placeholder string.project and token values per environment. Keep the token in secrets management and rotate it like any other Bearer credential.201, non-201, and transport failures. Keep one integration test against a real sandbox if Kendo provides one.connect_timeout and timeout values. Non-positive timeout values are floored to the package default, so 0 does not mean “no timeout.”swallow=true hides failures from normal Laravel exception handling. Failures go to local PHP error_log, not necessarily your configured Laravel log channel. Avoid enabling it in production unless you actively monitor that log and can tolerate silent null returns.ReportSubmissionException carries the HTTP status for non-201 responses and 0 for transport failures. Use that distinction for retries and alerting.201 is success. Other 2xx responses are treated as failures. Do not assume any non-exception response is a successful Kendo submission.report:create scope. A valid token with the wrong scope will fail at the HTTP layer; check scope before debugging the payload.UploadedFile instances or download them first.REPORT_TOOL_* values. Standard Laravel config caching applies; stale cached config is a common cause of “it still uses the old project/token.”How can I help you explore Laravel packages today?