- How do I install spatie/laravel-disable-floc in my Laravel project?
- Run `composer require spatie/laravel-disable-floc` in your project root. The package auto-registers the middleware in Laravel’s web group, so no additional steps are needed unless you want customization.
- Does this package work with Laravel 10 or newer?
- The package was last updated in 2022 and may not officially support Laravel 10+. Test thoroughly in a staging environment, as middleware behavior can vary across major Laravel versions.
- Can I disable FLoC only for specific routes in my Laravel app?
- Yes, use Laravel’s middleware grouping. Wrap routes in `Route::middleware(DisableFloc::class)->group(function () { ... })` to apply it selectively.
- Is this package still relevant since Google deprecated FLoC?
- While FLoC is deprecated, this package may still help block legacy tracking or serve as a placeholder for future privacy controls. For modern alternatives, consider Topics API opt-outs or Permissions-Policy headers.
- Will this package interfere with other middleware like CORS or security headers?
- The middleware injects a `Permissions-Policy` header. Ensure it runs *after* other header-modifying middleware (e.g., `TrustProxies`, `ShareHeaders`) in your stack to avoid conflicts.
- How do I verify FLoC is disabled after installation?
- Use Chrome DevTools to check the `Permissions-Policy` header in responses. Tools like [FLoC Detection](https://github.com/am i flocced) or Chrome’s `chrome://flags/#privacy-sandbox` can confirm the opt-out.
- Does this package support Laravel Lumen or Forge/Valet deployments?
- Yes, the package works with Lumen and is compatible with Forge/Valet. Register the middleware in your Lumen `bootstrap/app.php` or Laravel’s `AppServiceProvider` as usual.
- Are there alternatives to this package for broader privacy controls?
- For comprehensive privacy, combine this with packages like `spatie/laravel-activitylog` (audit trails) or `spatie/laravel-honeypot` (bot protection). For modern tracking, explore `spatie/laravel-permissions-policy`.
- Will disabling FLoC break any existing ad-targeting or analytics?
- FLoC was rarely adopted, but if your app relies on Google’s experimental tracking, test thoroughly. This package *only* disables FLoC—other trackers (e.g., Google Analytics) remain unaffected.
- Is there a way to customize the Permissions-Policy header beyond disabling FLoC?
- The package doesn’t expose direct customization, but you can publish its config (if available) or manually override the middleware in `app/Http/Middleware/DisableFloc.php` to extend the header.