Skip to content

Store reports on a configurable filesystem disk - #699

Closed
jure-knezovic wants to merge 1 commit into
statamic:7.xfrom
jure-knezovic:feature/reports-disk
Closed

jure-knezovic wants to merge 1 commit into
statamic:7.xfrom
jure-knezovic:feature/reports-disk

Conversation

@jure-knezovic

@jure-knezovic jure-knezovic commented Oct 20, 2026 •

Copy link
Copy Markdown

Reports, their chunks and their pages were written with the File facade to a hard-coded storage_path(). Where the filesystem is not shared between processes or does not survive a deploy (containers, serverless platforms, autoscaled instances), the report the "Generate" request wrote is not there for the redirect that follows, so the show page answers 404, and the chunks the queue worker writes are never seen by the web process.

A new reports.disk config key names a disk from config/filesystems.php to store the reports on. Unset, a local disk rooted at storage/statamic/seopro/reports keeps the current layout, so existing reports and the existing tests stay as they are. The report's folder and path methods are relative to that disk now; pagesFolder() is new, preparePath() is gone (a disk creates directories on write).

Closes #698

Reports, their chunks and their pages were written with the File facade to
a hard-coded storage_path(). Where the filesystem is not shared between
processes or does not survive a deploy (containers, serverless platforms,
autoscaled instances), the report the "Generate" request wrote is not
there for the redirect that follows, so the show page answers 404, and the
chunks the queue worker writes are never seen by the web process.

A new `reports.disk` config key names a disk from config/filesystems.php
to store the reports on. Unset, a local disk rooted at
storage/statamic/seopro/reports keeps the current layout, so existing
reports and the existing tests stay as they are. The report's folder and
path methods are relative to that disk now; `pagesFolder()` is new,
`preparePath()` is gone (a disk creates directories on write).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@duncanmcclean

Copy link
Copy Markdown
Member

Thanks for the pull request!

However, I think we should make it possible to store reports in a database, like you can with other Statamic things, rather than making the filesystem configurable.

With that said, I'm going to close this PR. I'd happily accept a PR that makes reports storable in the database. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to store reports in the database

2 participants