eekes/sulu-spam-protection-bundle
A spam protection bundle for Sulu CMS that helps guard forms against bots and unwanted submissions. Adds configurable spam checks and validation to reduce fake entries while keeping legitimate user submissions flowing smoothly.
This release (v1.0.3) adds a translate field plus additional translations, so the first move is to confirm what actually changed in the package internals before wiring it into an app.
composer update <vendor>/<package> and inspect git diff v1.0.2..v1.0.3 in vendor/. You are looking for: a new migration or column definition (the "translate field"), new translation keys/JSON files (the "extra translations"), and any signature changes on the trait, contract, or facade.php artisan vendor:publish, your copies of config and language files will not contain the new translations. Re-publish with --force into a scratch dir and diff against your app copies, merging by hand rather than overwriting.If the repository has a CHANGELOG.md or upgrade guide, read that next — one-line release notes for a package that touches persisted schema are a signal to verify rather than assume.
Attach translation to models deliberately. The core day-to-day pattern is a model declaring which attributes are translatable and the package resolving them per locale. Keep that declaration in the model (a $translatable-style property or trait method), not scattered in controllers, so the set of translatable fields is greppable in one place.
Per-locale form handling. The usual workflow is a form request that validates locale-keyed input (title.en, title.fr) or a nested array (title => ['en' => ..., 'fr' => ...]), then a single save. Validate each configured locale with the same rule set generated from config('app.locales') so adding a locale does not silently skip validation.
Fallback resolution belongs in the read path. Decide once whether a missing translation falls back to the default locale, returns null, or returns the raw key. Set it in the package config rather than sprinkling ?? $model->title in Blade. With extra translations arriving in this release, check whether fallback behaviour or the locale list changed.
Use it in API resources, not raw attributes. Serialise through an API Resource or a toArray() override that calls the package's accessor, so clients receive a predictable shape. Returning the raw JSON column leaks every locale including drafts.
Seeding and imports. When importing content, write the translate field as a structured array keyed by locale in one pass. Batch this — per-locale save() loops on large imports are the common performance trap.
Testing. Assert on both the happy path and the fallback path: a translated attribute in a non-default locale, and one where the translation is absent. If the package registers its own locale resolver, use its testing helper or set the locale in setUp() so tests do not depend on ambient state.
1.0.3 explicitly, deploy to staging, and confirm the column exists and is populated before rollout.where('title', 'x') will not match; you need driver-specific JSON path queries (whereJsonContains, -> syntax) and MySQL 5.7+/Postgres/SQLite 3.9+ awareness. Verify the package does not abstract this differently than you assume.with() for translation attributes and assume a win.updated_at.How can I help you explore Laravel packages today?