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

Statamic Preference Center Laravel Package

goldnead/statamic-preference-center

A Statamic addon that adds a preference center for managing visitor consent and privacy settings. Lets users review and toggle cookie categories or preferences from a single panel, with control over what is stored and how choices are applied across your site.

View on GitHub
Deep Wiki
Context7

Getting Started

This addon gives you a public preference center (subscription/consent management) with four public routes and no Control Panel screen of its own — which is exactly the gap v1.8.0 closes. Start by reading config/preference-center.php: it is still the source of truth, and every Control Panel value is stored as a deviation from it, not as a replacement config.

Minimal setup:

  1. Require goldnead/statamic-brand-context 1.13 or newer. Older versions carry the settings page but apply it unreliably (last-registered addons' settings never reaching config on single-brand installs; and up to 1.12 a second save of the same section silently deleted the first save's override).
  2. If you set any values before upgrading, re-check them after the update — they may have been dropped by the 1.12 bug.
  3. Assign the new permission manage preference-center settings to a role. Nobody holds it by default, so until you do, Settings → Addon Settings shows no section at all.
  4. Configure the groups: Magic link, Throttling, Sender, Blocks on the page, Audit trail.

First use case: turn on the preference center, set a sane magic-link lifetime and session duration, set throttling per address and per origin, and leave "links to unknown addresses" off. That last one is the difference between a preference center and an open mail relay with extra steps.

Implementation Patterns

Config-first, settings-as-overrides. Treat config/preference-center.php as the documented default and the Control Panel as per-environment deviation. In code, always read through config() — never try to read the settings store directly. This keeps local/staging/production behaviour explainable and makes the settings page purely an operator tool.

Magic link flow. The signed URL lifetime and the post-click session lifetime are separate knobs. Keep the response-time floor enabled: without it, response timing reveals whether an address is on the list (fast = unknown, slow = mail queued). Pair the "unknown addresses" toggle with the per-origin throttle — the origin counter is what stops someone using your endpoint to mail a list of addresses that isn't theirs.

Sender fallback. Set the fallback sender address/name for brands without their own sender identity. If the brand context provides one, that wins — don't try to override it from the addon.

Block visibility as a deployment concern. The notification, suppression-list and sequence blocks can be toggled on the page. Use these to roll out blocks per brand rather than shipping template edits.

Audit trail. Enable reporting of applied changes to LeadHub where you need an operator-action trail. Leave audit.log_channel in config; it is deliberately not on the page because log channels belong to the host and a typo there means audit entries go nowhere.

Route configuration is deploy-time. routes.enabled, routes.prefix and routes.middleware are read while routes are registered. Change them in config and deploy; the settings page correctly omits them. The same applies to the marketing block's token route: it asks at creation time whether the source is available, so that switch decides whether the route exists at all.

Gotchas and Tips

  • Invisible settings section. Not a bug: the section is gated by manage preference-center settings, which no role holds initially. Assign it first, then look.
  • Brand-context version floor. Pin goldnead/statamic-brand-context:^1.13. On a single-brand install with older versions, addons registered last silently failed to receive their settings.
  • Re-check overrides after upgrading. The pre-1.13 double-save bug deleted earlier overrides without warning. Verify each group after deploy.
  • Half-effective toggles are worse than absent ones. Route registration and the marketing token route's source availability are evaluated at boot. Don't expect flipping a config value at runtime to add or remove those routes; it takes a deploy.
  • delivery.mail_headers and delivery.ignored_query_parameters stay in config. They are part of the protocol contract with the mail provider, not operator policy.
  • Timing side channel. If you must disable the response-time floor for debugging, re-enable it before exposing the endpoint. It is a privacy control, not a performance tweak.
  • Extension point. If you need behaviour the settings page doesn't expose (route shape, mail headers, audit channel), publish and edit the config file rather than reaching into the addon's internals — the override model assumes config is the baseline.
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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings