{"id":22021384,"url":"https://github.com/nhymxu/php-floc-disable","last_synced_at":"2026-04-28T21:03:57.338Z","repository":{"id":51366979,"uuid":"366318474","full_name":"nhymxu/php-floc-disable","owner":"nhymxu","description":"PHP middleware to disable Google's Federated Learning of Cohorts (FLoC) tracking","archived":false,"fork":false,"pushed_at":"2021-05-13T08:14:34.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-28T16:44:53.785Z","etag":null,"topics":["floc","floc-disable","http","middleware","psr-15"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nhymxu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"nhymxu","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.me/nhymxu","https://nhantien.momo.vn/WTOl9cURX5P"]}},"created_at":"2021-05-11T08:58:30.000Z","updated_at":"2021-05-13T08:12:48.000Z","dependencies_parsed_at":"2022-09-05T18:01:45.306Z","dependency_job_id":null,"html_url":"https://github.com/nhymxu/php-floc-disable","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"nhymxu/.github","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhymxu%2Fphp-floc-disable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhymxu%2Fphp-floc-disable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhymxu%2Fphp-floc-disable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhymxu%2Fphp-floc-disable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nhymxu","download_url":"https://codeload.github.com/nhymxu/php-floc-disable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245084775,"owners_count":20558281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["floc","floc-disable","http","middleware","psr-15"],"created_at":"2024-11-30T06:11:42.546Z","updated_at":"2026-04-28T21:03:52.295Z","avatar_url":"https://github.com/nhymxu.png","language":"PHP","funding_links":["https://ko-fi.com/nhymxu","https://www.paypal.me/nhymxu","https://nhantien.momo.vn/WTOl9cURX5P"],"categories":[],"sub_categories":[],"readme":"# nhymxu/php-floc-disable\n\n[![packagist](https://img.shields.io/packagist/v/nhymxu/php-floc-disable.svg?style=flat-square)](https://packagist.org/packages/nhymxu/php-floc-disable)\n[![phpunit](https://github.com/nhymxu/php-floc-disable/actions/workflows/phpunit.yml/badge.svg?branch=main)](https://github.com/nhymxu/php-floc-disable/actions/workflows/phpunit.yml)\n\nPHP middleware to disable Google's Federated Learning of Cohorts (`FLoC`) tracking\n\n## Usage\n\nThis package is installable and auto-loadable via Composer as nhymxu/php-floc-disable.\n\n```shell\ncomposer require nhymxu/php-floc-disable\n```\n\n### Slim 4 integration\n\nAdd the `FlocDisableMiddleware` to set the header\n\nExample: `public/index.php`\n\n```php\n\u003c?php\n\nuse Psr\\Http\\Message\\ResponseInterface as Response;\nuse Psr\\Http\\Message\\ServerRequestInterface as Request;\nuse Nhymxu\\FlocDisable\\FlocDisableMiddleware;\nuse Slim\\Factory\\AppFactory;\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\n$app = AppFactory::create();\n\n// Add Slim routing middleware\n$app-\u003eaddRoutingMiddleware();\n\n// Set the header to disable FLoC.\n$app-\u003eadd(new FlocDisableMiddleware());\n\n$app-\u003eaddErrorMiddleware(true, true, true);\n\n// Define app routes\n$app-\u003eget('/', function (Request $request, Response $response) {\n    $response-\u003egetBody()-\u003ewrite('Hello, World!');\n    return $response;\n})-\u003esetName('root');\n\n// Run app\n$app-\u003erun();\n```\n\n## Support\n\n* Issues: \u003chttps://github.com/nhymxu/php-floc-disable/issues\u003e\n* Here you can [donate](https://dungnt.net/donate.html) for this project.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhymxu%2Fphp-floc-disable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhymxu%2Fphp-floc-disable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhymxu%2Fphp-floc-disable/lists"}