Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Legal Documents Laravel Package

vlados/laravel-legal-documents

Manage legal documents in Laravel with versioned policies, publishable content, and user acceptance tracking. Includes migrations, models, and helpers to keep terms of service and privacy policies current and auditable.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • This is a Laravel package that owns the full lifecycle of legal documents: versioned content, published views/routes, per-user acceptances, and notifications. v2.0.0 makes multilingual content a first-class but optional concern, which is the correct architectural call for a package whose user base is mostly single-language.
  • The vendor-neutral TranslationDriver contract plus a bundled Spatie adapter is a sound layering choice: the package does not force a specific translation stack, and the core domain (versions, acceptances) stays independent of storage strategy. This reduces lock-in and keeps the blast radius of a future Spatie replacement contained to one adapter.
  • Keeping translations in separate tables, rather than overloading scalar source fields, preserves existing document version IDs and acceptance records — which is exactly what a legal-evidence system must do. Acceptances remain immutable records pointing at a version, so translation work cannot retroactively alter what a user agreed to.
  • The stated "complete-document fallback" (fall back the whole document, not per field) is a defensible simplification for legal text — a half-translated clause set is arguably worse than a fully source-language document — but it needs to be an explicit product decision, not an accident of implementation.

Integration feasibility

  • Low-friction for single-language consumers: no migrations, no data conversion, no configuration required beyond the version bump. That covers the majority of installs and keeps upgrade cost near zero.
  • Multi-language adoption requires deliberate steps: declare spatie/laravel-translatable explicitly, configure a driver and source language, run the adapter migrations, and publish/merge config and Blade views. This is a contained, well-documented path (two linked guides), but it is not a "install and go" experience.
  • The Filament 4 targeting and removal of the Lara Zeus plugin are the two items most likely to block an otherwise simple upgrade for teams with customized admin panels.

Technical risk

  • Silent misconfiguration is the top risk. "Installing Spatie alone does not enable translations" means a team can believe they are multi-language while the package quietly serves source-language only, or vice versa. Precedence rules (Spatie's explicit global fallback wins; package config applies when unset/null) add a second layer where a shared config value can produce surprising output.
  • Published view drift. Any application that published and edited the Blade views in v1 will not automatically pick up the new translation APIs. Upgrading without re-merging views is a plausible path to broken public legal pages and broken recipient notification emails — high-visibility, high-severity failures.
  • Acceptance semantics under translation are unspecified in the notes. If a user accepts a document delivered in a localized locale, the record must be defensible: which locale was rendered, which version, and what content the user actually saw. This is the single largest legal/compliance question and the notes do not resolve it.
  • Dependency removal is not runtime-safe by default. Removing Spatie from an app that has the bundled adapter enabled will fail at the class level unless configuration is also switched off. The CI covers "optional dependency removal," which is reassuring, but the failure mode in real deployments is a boot-time exception rather than a graceful fallback.
  • Filament 4 only. Teams on Filament 3 must either stay on v1.x or absorb a Filament major upgrade in the same change window — two coupled upgrades, which is where release trains usually slip.
  • Version-copy transactionality is now doing more work (all translations copied, acceptances deliberately not copied). The concurrency regression coverage on PostgreSQL 16/18 and MySQL 8 is a good signal, but longer transactions mean longer lock windows on documents with many locales.
  • Laravel 11–13 in CI — worth confirming whether Laravel 13 is a released or pre-release target, since claiming support for an unreleased major is a compatibility statement, not a validated one.

Key questions

  • Does an acceptance record capture the locale in which the document was rendered, in addition to the version ID? If not, what is the audit story for a recipient who was served a translated document?
  • Is translation completeness validated at publish time, or can a version be published with some locales present and others silently falling back?
  • What is the observed behavior — exception, warning, or silent no-op — when the adapter is enabled but Spatie is absent, and is it surfaced in logs?
  • Do the published Blade views and notification templates need mandatory re-publication, and is there a deprecation shim, or is it a hard break?
  • Is TranslationDriver considered a stable public API from v2.0.0, or explicitly experimental?
  • What is the support posture for third-party drivers, and who owns bugs in a driver the package does not ship?
  • Any guidance for apps on Filament 3 — is a compatibility range planned, or is v1.x the recommended long-term branch for them?

Integration Approach

Stack fit

  • Standard Laravel + Composer install; the package slots in as a normal service provider with publishable config, views, and migrations. No new runtime infrastructure (no queue backend, no search service, no cache dependency) is required for core operation.
  • Optional surfaces map cleanly onto the existing stack: Spatie Translatable for storage, Filament 4 for admin, Laravel's localization and mail/notification pipeline for public pages and recipient emails.
  • PostgreSQL and MySQL are both validated, which covers the realistic spread of Laravel production deployments. Teams on other engines (MariaDB, SQL Server) should treat support as unverified.

Migration path

  1. Pin to ^2.0 and run composer update. Resolve the dependency delta explicitly: add spatie/laravel-translatable if translations are wanted or if any code path touches the adapter; remove lara-zeus/translatable if it was only there for this package.
  2. Diff published configuration against the v2 defaults and merge deliberately — do not blind-republish over customized config.
  3. Diff published Blade views and notification templates against v2 and port customizations forward onto the new translation APIs. Treat this as required work, not cleanup.
  4. If multi-language: configure driver, source language, and fallback explicitly; publish and run the adapter migrations; seed translations before enabling locales for users.
  5. If single-language: skip step 4 entirely. Confirm the adapter is disabled so no Spatie classes are resolved.
  6. Verify existing acceptance records and document version IDs are untouched (they should be, per the notes) with a row-count and spot-check comparison before and after.

Compatibility

  • Laravel 11–13 per CI. Filament 4 for the admin integration. Spatie is optional but must be declared if used.
  • Preserved across the upgrade: scalar source fields, routes, document version IDs, acceptance records. This is the strongest part of the release — no evidence-data migration is required, which removes the highest-risk class of upgrade work.
  • Breaking surfaces: declared dependency set, Filament major, removal of the Lara Zeus dependency, and any app-authored config or views touching translation APIs.

Sequencing

  • Keep the upgrade and the multilingual rollout as two separate changes. Ship v2.0.0 in single-language mode first (a no-op change), confirm nothing regressed, then enable translations behind configuration in a follow-up.
  • Where Filament 3 is in use, split the Filament 4 upgrade from the package upgrade — or accept staying on v1.x deliberately with a dated review.
  • Stage on the same database engine and major version as production (especially PostgreSQL 16 vs 18) so the serialization/retry behavior in the concurrency paths is exercised identically.
  • Roll out translations to a single non-source locale and a small recipient cohort before enabling broadly, and validate the rendered public page and the actual delivered email for that locale.

Operational Impact

Maintenance

  • Net maintenance win on dependencies: Spatie is no longer mandatory and the Lara Zeus plugin is dropped, shrinking the transitive dependency surface and the number of packages that can block a Laravel major upgrade.
  • Offset by added configuration surface — driver, source language, fallback, adapter enablement — with non-obvious precedence. Configuration drift across environments becomes a realistic source of "works in staging" incidents.
  • Published-view ownership shifts to the consuming team: translations touch the templates, so view customizations now require re-merging on every release that changes them. Budget recurring effort for this.

Support

  • Two distinct user populations with different failure modes: single-language consumers (near-zero support load) and multi-language consumers (configuration- and template-related issues). Support runbooks should fork accordingly.
  • The vendor-neutral driver contract creates a support boundary question: bugs in a homegrown or third-party driver will present as package bugs. Establish a triage rule up front (reproduce with the bundled adapter or it is out of scope).
  • Bulgarian/English interface labels signal the author's primary locales; other locales need interface overrides, and that expectation should be set with the team rather than discovered.

Scaling

  • Translations add tables and joins to public document rendering — the highest-traffic path in this package. Public legal pages are usually cacheable and low-write, so the practical risk is manageable, but confirm the read path is covered by whatever caching layer the app already uses.
  • Localized recipient notifications move locale resolution into the notification/queue path. For large recipient batches this is a per-recipient lookup; verify it is batched or cached, not N+1.
  • Transactional version copying that now spans all stored translations lengthens write transactions. With many locales and large documents, watch lock contention on document publish — the concurrency tests target correctness, not throughput under load.
  • Acceptance writes remain the high-concurrency path and are unaffected by this release, which is the right thing to have left alone.

Failure modes

  • Misconfiguration presented as missing content: adapter disabled or source language wrong → users see untranslated documents with no error. Detect via a publish-time or health-check assertion, not user reports.
  • Complete-document fallback in production: a partially translated version serves entirely in the source language. Acceptable by design, but must be a stated product behavior so it isn't reported as a bug during a launch.
  • Stale published views after upgrade → broken public pages or malformed emails. Highest-severity, most likely post-upgrade incident; mitigate with a post-deploy smoke test in every enabled locale.
  • Class-not-found on dependency removal if Spatie is dropped while the adapter stays enabled. Guard with a config check in CI or a startup validation.
  • Fallback precedence conflict: a Spatie global fallback set elsewhere in the app silently overriding the package's configured fallback for legal content — wrong-language legal text is a compliance issue, not a cosmetic one.
  • Filament partial saves leaving untouched languages unpersisted; the notes claim preservation, but this deserves an explicit admin QA pass since it is easy to regress and hard to notice.
  • Locale write concurrency under simultaneous translation edits; covered by the PostgreSQL serialization rollback/retry tests, and worth re-validating on the team's actual engine/version.

Ramp-up

  • Single-language teams: effectively zero — version bump, smoke test, done.
  • Multi-language teams: meaningful. Requires working knowledge of Spatie Translatable's storage model, Filament 4 admin patterns, the package's driver/fallback precedence, and a template re-merge discipline. Estimate a sprint of engineering plus a legal/compliance review of the acceptance-record semantics before enabling any non-source locale in production.
  • Document the fallback precedence and the accepted-locale audit answer before rollout; both are questions legal will ask, and both are cheaper to answer in design than in an incident review.
  • Overall: v2.0.0 is a well-scoped, low-risk upgrade for the majority of consumers and a moderately complex one for multi-language adopters. Recommend upgrading to v2.0.0 in single-language mode promptly, and treating multilingual enablement as a separately planned, separately approved initiative gated on the acceptance-locale question.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums