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 Spam Protector Laravel Package

johannebert/laravel-spam-protector

Protect Laravel forms from spam with this lightweight package offering configurable spam detection, blocked keywords, rate limiting, and honeypot-style checks—easy to drop into any form without external services.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with composer require vendor/package. As of v7 the constraint floor is PHP 8.0+ and laravel/framework ^9.0 — if you are still on Laravel 8 or PHP 7.4, pin to the v6 line instead of forcing the upgrade.
  • If composer require fails, run composer why-not vendor/package 7.0 first. On Laravel 9 the usual culprit is a transitive dependency locked to Symfony 5 components.
  • On a fresh install, confirm the service provider is picked up by package discovery (php artisan about on Laravel 9 lists discovered providers), then publish what you need:
    • php artisan vendor:publish --provider="Vendor\\Package\\PackageServiceProvider" --tag=config
    • php artisan vendor:publish --provider="Vendor\\Package\\PackageServiceProvider" --tag=migrations
  • Quickest first use case: publish the config, run php artisan migrate, then exercise the package's main entry point (facade, helper, or injected contract) from php artisan tinker before wiring it into a controller. This isolates configuration problems from application problems.
  • Read the package's UPGRADE.md / CHANGELOG.md before anything else — the Laravel 9 bump is the headline, but point releases in a major often carry interface changes alongside it.

Implementation Patterns

  • Resolve from the container, never new. Bind the package's contract in a service provider and type-hint it in constructors. This is what makes the package swappable and fakeable in tests.
  • Config over constants. Publish the config file, commit it, and drive values from env() only inside the config file — not at call sites. This survives config:cache, which is where most "works locally, breaks in production" reports originate.
  • Wrap the package behind your own thin adapter if you call it from more than a handful of places. Laravel 9 support means the package is alive, but a major version bump is exactly when you want a single seam to patch.
  • Push long-running package operations onto the queue. Anything doing HTTP, file, or PDF/image work should be a job with retries and a timeout, not an inline controller call.
  • Test against the real container. Use RefreshDatabase for anything touching published migrations, and Http::fake() / Queue::fake() for the package's outbound edges. If the package ships a fake, register it in setUp() rather than mocking internals.
  • Multi-tenant / multi-connection setups: re-bind the package's connection or config at runtime per tenant, and re-register after config() mutations — some packages snapshot config at boot time in the service provider.
  • Upgrade workflow: branch, bump the constraint, run the full test suite plus a staging deploy against a config-cached build. Config caching is the cheapest way to surface Laravel 9 boot-order regressions.

Gotchas and Tips

  • Package discovery is cached. After upgrading, composer dump-autoload and php artisan package:discover before debugging anything else. A stale bootstrap/cache/packages.php produces "class not found" errors that look like install failures.
  • config:cache freezes config. Any env() call inside the package's runtime code (rather than its config file) returns null in production. Verify by running php artisan config:cache locally — this is the single most common post-upgrade bug.
  • Laravel 9 removed deprecated string/array helpers. If you extended or overrode package internals that used str_* / array_* global helpers, v7 has almost certainly migrated to Illuminate\Support\Str / Arr. Check your own subclasses and decorators, not just the package.
  • Symfony 6 underneath. Exception signatures, Command return types (int is now enforced), and Process APIs tightened. Custom artisan commands extending the package's commands may need explicit return types.
  • Publish tags are not guaranteed stable across majors. If --tag=config silently publishes nothing, run the publish command with --provider alone and diff what appears in config/ and database/migrations/.
  • Migrations are publish-once. After upgrading, compare the package's shipped migrations against the copies in your app — new columns in v7 will not appear unless you re-publish or hand-write a migration.
  • Debugging: enable the package's own log channel (usually a dedicated entry in config/logging.php), and set APP_DEBUG=true in a scratch environment. If behaviour differs between php artisan serve and Octane, suspect state held on a singleton resolved in the service provider.
  • Extension points to prefer: container bindings, published config, and events the package dispatches. Avoid subclassing concrete package classes — those are the surfaces most likely to shift in v8.
  • Pin the major. Use "vendor/package": "^7.0" rather than "*", and let Dependabot surface minor bumps so a Laravel 9 patch release does not arrive silently alongside behaviour changes.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console