Skip to content

Document Lifecycle: overview

Keep each published version of your policies, terms and contracts, with a record of who accepted it.

Staff add a document in the admin, paste in its text and press Publish version. Each version keeps its exact words and a fingerprint of that text. It can’t be edited or deleted. Once a document has versions, it can be archived but not removed. Compare with previous shows the changed lines and lets you download the full difference. Publishing Studio is needed for Document Lifecycle to run.

Record acceptance logs the signed-in staff member’s acceptance of the latest version. Your site can also send a customer or visitor a private link to read and accept it. With Customer Portal, signed-in customers are offered newer versions of documents they accepted before. Your developer can require signed-in users to accept selected documents before they continue. This is off by default and leaves guests alone. Acceptance records can’t be changed later.

A review date is shown for reference and starts no tasks. The Acceptances tab lets you download a spreadsheet of who accepted each version, or a signed file for one record.

Document Lifecycle keeps an installation-wide register of controlled documents such as policies and procedures. Each publication stores a version label, publication time, actor, content hash, and content snapshot. Acceptances are tied to the exact published version and hash, so later publications do not rewrite earlier evidence.

Install Publishing Studio first, install Document Lifecycle, and run its migrations. The package extends the existing legal_acceptances table as well as creating document and publication tables; Diagnostics reports missing tables, columns, or model registrations.

Open Workflow > Controlled documents. Access uses the generated Document permissions, while global administrators bypass those checks. Documents have no Site field and the resource is not site-scoped, so anyone who can view documents can see the installation-wide register and its publication and acceptance evidence.

Create a document with a stable Key and Title. The key cannot be changed after creation. Review due and Expires at are operational dates; neither changes the stored publication evidence.

Use Publish version to enter the controlled text, an optional version label, and an optional note. Leaving the version blank creates a timestamp-based label. Publishing changes the document to Active and stores the content snapshot in publication metadata together with its SHA-256 hash. Publication rows are immutable: publishing the same version label and identical content returns the existing publication, while reusing that label for different content fails and leaves the original unchanged. Use a new version label for every content change.

When a registered document is linked to a Publishing Studio draftable record, a matching published revision also creates a document publication automatically. Its version is labelled from the Publishing Studio revision. This bridge does not register arbitrary content as a controlled document; the document relationship must already exist.

Record acceptance records the signed-in administrator against the latest publication. It is unavailable until at least one version exists. The record includes the version and document hash, context and optional note, acceptance time, and hashes of the request IP address and user agent. It does not store those two request values in plaintext. Keep the application key stable because it contributes to those hashes.

Open a document’s Acceptances relation to:

  • export acceptance evidence for all versions or one selected publication as CSV;
  • export the outstanding-acceptance report as CSV; or
  • download an individual acceptance certificate as JSON.

Treat these downloads as sensitive audit records. If Customer Portal is installed, an authenticated portal account can see up to its ten latest matching acceptances as self-service history; that feed exposes document key/version metadata, not the stored content snapshot or a certificate download.

CreateDocumentAcceptanceUrlAction::run($document, $person, siteId: $siteId, issuer: $staffUser) returns a signed link that expires after 14 days unless you pass expiresAt. Send it to the person by your own channel. The link opens /document-acceptance, which shows the document title, the latest version label and its published text. Text and JSON snapshots are both shown as escaped plain lines, never rendered as Markdown or HTML. The person ticks a confirmation and submits; the acceptance is recorded with that person as both acceptor and subject, the context acceptance_link, the site in its metadata, and hashes of their IP address and user agent.

  • Who may create a link. When you pass an issuer, that user must be allowed to update the document. A link for a site needs an issuer who can work on that site; a link with no site needs a global administrator. Without an issuer the call is trusted code acting for the person, such as the Customer Portal listing an account’s own documents. A person with a site_id (for example a portal account) only gets a link for their own site.
  • What the link carries. The person, subject, site and expiry time are encrypted inside the link and covered by its signature, so the link reveals no record IDs and cannot be edited. Only the signed query string is read: a link value sent in a form body is ignored, and a payload past its own expiry is refused wherever it appears. Any change to the link, or using it after it expires, returns 403. A link whose person or document no longer exists, or whose document is not active (draft or archived), returns 404.
  • Which version is accepted. The form sends the content hash of the version the page showed, and the acceptance is recorded only if it still matches the latest version. If a newer version is published before the person submits, nothing is recorded and the page shows the new version to read first. A document without published text cannot be accepted.
  • Repeat submissions. Each link acceptance stores a one-way acceptance_key for the person, subject and version, and a unique index on that column makes the database refuse a second one, even when two submissions race. Submitting again returns the existing acceptance. If the submission cannot be processed at that moment, the person is asked to try again. Acceptances recorded any other way leave the key empty. Submissions are limited to 10 a minute per link and client, and 30 a minute per client; page views to 60 a minute per link and client.
  • Re-acceptance. Once the link’s person has accepted the latest version for its subject, the page says so and shows no form. Another person’s acceptance for the same subject does not hide it. With Customer Portal installed, each account sees a Review and accept item, carrying its own signed link, for every active document it accepted for itself before that now has a newer version. RequiresDocumentReAcceptanceAction decides this, and it counts an acceptance about the account, or one the account gave without naming a separate subject (for example at sign-up). An acceptance the account gave on behalf of someone else does not count.

The page is not cached, is marked noindex, and sends no referrer. Retention minimisation clears an acceptance’s metadata, which removes the recorded site along with any notes.

The optional document.acceptance middleware stops signed-in users before a configured page or operation until they accept the current publication of each selected document. It also covers first acceptance. It is disabled by default, and guests pass through. Add it after your web and authentication middleware on selected routes; configure exact document keys and route-name or path patterns. GET requests return to the requested page after acceptance. Interrupted writes must be submitted again. See the configuration and route example.

Review due is an informational date shown in the document list. The package does not notify reviewers, create review tasks, or archive a document when that date passes.

Expires at is enforced by capell:document-lifecycle:archive-expired. The package schedules that command daily with overlap protection and single-server locking, so keep Laravel’s scheduler running and configure a shared scheduler lock store in a multi-server deployment. The command archives only Active documents whose expiry time has passed. It does not delete publications or acceptances.

You can archive a document manually. Restoring an archived document returns it to Active when it has a publication, or Draft when it does not. Publishing an archived document from the domain integration also activates it; use permissions and operational review rather than treating Archived as an immutable lock.

Publication metadata contains the full text or JSON snapshot in plaintext; its hash is evidence of content integrity, not encryption. Acceptance context, notes, actor/subject identifiers, and timestamps are also plaintext, while document, IP, user-agent, and legal-bundle hashes are one-way values. Protect database access, backups, CSV files, and certificates accordingly.

The package registers Core privacy export and erasure contributors and integrates with Privacy Centre when it is available. An account export includes acceptances where that account is the acceptor or subject. Erasure minimises address/browser hashes and free-form metadata, and reports anonymisation rather than deletion. It retains the account links, document version/hash, acceptance time and context as immutable legal evidence under the existing evidence policy. This is minimisation, not removal of every identifying link. Archiving retains all versions and acceptances; there is no automatic age-based pruning. Operators must determine the legal retention period and handle any requirement to remove retained evidence through a reviewed legal process.

Published versions and recorded acceptances are evidence and cannot be rewritten or removed through the models or their Eloquent queries: single saves and deletes, and bulk update(), delete(), forceDelete(), increment(), upsert() and truncate() calls on DocumentPublication and DocumentAcceptance queries, throw PublicationEvidenceProtectedException. The one permitted acceptance write is retention minimisation: setting ip_hash, user_agent_hash and metadata to null. In the database, a document with published versions and a publication that acceptances point at cannot be deleted (RESTRICT foreign keys; the migration that adds them is forward-only and keeps them on rollback). Recording an acceptance for a document key that has a registered document requires a published version and stores its publication and hash; the call throws PublicationEvidenceProtectedException while that document has none. A key with no registered document (for example terms managed as CMS pages) is still recorded with its configured version label and no publication or hash. Raw query-builder writes (DB::table(...) or ->toBase()) are outside this supported boundary: the database still refuses the restricted deletes, but nothing else stops a raw write, so integrations must not use one against these tables.

The outstanding report covers previous acceptors only. It compares each subject’s latest recorded acceptance with the current publication and content hash, and includes those needing renewal. A current acceptance is excluded. People with no recorded acceptance are also excluded: the package does not know your organisation’s complete intended audience. Use your own audience list to find and contact them.

With no previous acceptors, the CSV contains headings only. An empty report is not an all-complete result and does not establish that everyone has accepted.


For how to use Document Lifecycle, see the admin guide. For developers: see the README.