{"id":36573474,"url":"https://github.com/42coders/eu-cookie-consent","last_synced_at":"2026-01-12T07:21:00.922Z","repository":{"id":52683845,"uuid":"307778552","full_name":"42coders/eu-cookie-consent","owner":"42coders","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-02T01:55:21.000Z","size":102,"stargazers_count":59,"open_issues_count":6,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-12-25T02:59:56.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/42coders.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-27T17:31:13.000Z","updated_at":"2025-11-20T17:29:14.000Z","dependencies_parsed_at":"2022-08-24T10:20:11.669Z","dependency_job_id":null,"html_url":"https://github.com/42coders/eu-cookie-consent","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/42coders/eu-cookie-consent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42coders%2Feu-cookie-consent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42coders%2Feu-cookie-consent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42coders%2Feu-cookie-consent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42coders%2Feu-cookie-consent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/42coders","download_url":"https://codeload.github.com/42coders/eu-cookie-consent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42coders%2Feu-cookie-consent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28336500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-12T07:21:00.171Z","updated_at":"2026-01-12T07:21:00.915Z","avatar_url":"https://github.com/42coders.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eu-cookie-consent helps you to stay conform with the EU cookie law\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/the42coders/eu-cookie-consent.svg?style=flat-square)](https://packagist.org/packages/the42coders/eu-cookie-consent)\n[![Build Status](https://img.shields.io/travis/42coders/eu-cookie-consent/master.svg?style=flat-square)](https://travis-ci.org/42coders/eu-cookie-consent)\n[![Total Downloads](https://img.shields.io/packagist/dt/the42coders/eu-cookie-consent.svg?style=flat-square)](https://packagist.org/packages/the42coders/eu-cookie-consent)\n\nAll sites owned by EU citizens or targeted towards EU citizens must comply with a crazy EU law. This law requires a dialog to be displayed to inform the users of your websites how cookies are being used. You can read more info on the legislation on [the site of the European Commission](http://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm#section_2).\n\nThis package provides an easily configurable view to display the message. Also included is JavaScript code to set a cookie when a user agrees with the cookie policy. The package will not display the dialog when that cookie has been set.\n\n![PopupImage](./resources/img/cookie_gdpr.png)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require the42coders/eu-cookie-consent\n```\n\nOptionally you can publish the following Files\n\n##### Config\nThis is recommended since you can configure all the consents you want to get from the visitor.\n``` bash\nphp artisan vendor:publish --provider=\"the42coders\\EuCookieConsent\\EuCookieConsentServiceProvider\" --tag=\"config\" \n```\n##### Views\nIf you want to customize the look and feel of the Package\n``` bash\nphp artisan vendor:publish --provider=\"the42coders\\EuCookieConsent\\EuCookieConsentServiceProvider\" --tag=\"views\" \n```\n##### Language files\nThis package comes with multilanguage support out of the box. You can translate it to the Languages you want. Or just change the default Text.\n``` bash\nphp artisan vendor:publish --provider=\"the42coders\\EuCookieConsent\\EuCookieConsentServiceProvider\" --tag=\"lang\" \n```\n## Config\nThis is the heart of the Package you can define all the Cookies/Permissions you want to get form the User.\n``` php\nreturn [\n\n    /*\n     * Use this setting to enable the cookie consent dialog.\n     */\n    'enabled' =\u003e env('COOKIE_CONSENT_ENABLED', true),\n\n    /*\n     * The name of the cookie in which we store if the user\n     * has agreed to accept the conditions.\n     */\n    'cookie_name' =\u003e 'laravel_eu_cookie_consent',\n\n    /*\n     * Set the cookie duration in minutes.  Default is 365 * 24 * 60 = 1 Year.\n     */\n    'cookie_lifetime' =\u003e 365 * 24 * 60,\n\n    /*\n     * Multilanguage support\n     *\n     * If enabled the title, description, the category keys and the cookie keys are defining the key from the translation files.\n     */\n    'multilanguage_support' =\u003e true,\n\n    /*\n     * Save Cookies Route\n     */\n    'route' =\u003e '/saveTheCookie',\n\n    /*\n     * Define the style of the Popup\n     */\n    'popup_style' =\u003e '',\n\n    /*\n     * Define classes the popup should use.\n     */\n    'popup_classes' =\u003e 'eu-popup',\n\n    /*\n     * If you want to have an Accept all Button for the users\n     */\n    'acceptAllButton' =\u003e 'true',\n\n    /*\n     * Cookies\n     */\n    'cookies' =\u003e [\n        //Defines the translation Key for the saveButton\n        'saveButton' =\u003e 'Save',\n        //Optional: Defines the translation Key for the PopupTitle\n        'title' =\u003e 'PopupTitle',\n        //Optional: Defines the translation Key for the PopupDescription\n        'description' =\u003e 'PopupDescription',\n        //To make the popup easier to consume for the user you can organize your Cookies in categories.\n        'categories' =\u003e [\n            //The key defines the translation key in the translations for this category.\n            'essential' =\u003e [\n                //Optional: The description defines the key in the translations for the category description\n                'description' =\u003e 'essential_description',\n                //In this array you can define all the Cookies you want to request form the User\n                'cookies' =\u003e [\n                    //The key defines the key in the translations and is used to access the Cookie specific information\n                    'session' =\u003e [\n                        //Optional: you can set forced to make it impossible for the user to not accept this cookie.\n                        'forced' =\u003e 'true',\n                        //Optional: The description defines the key in the translations\n                        //'description' =\u003e 'key in translation File'\n                    ],\n                    'xsrf-token' =\u003e [\n                        'forced' =\u003e 'true',\n                    ],\n                ],\n            ],\n        ],\n    ],\n\n];\n```\n\n## Usage\n\n##### Popup\nTo enable the Popup you can use the following Code in your blade Files (it returns html code).\n``` php\n{!! EuCookieConsent::getPopup() !!}\n```\n\nIf you want to give the users the option to change the permissions just add another line\n``` php\n{!! EuCookieConsent::getUpdatePopup() !!}\n```\nThis gives you the possibility to call the dialog with the given user settings by javascript.\n\nJust call the following js function and the popup will appear.\n``` js\nupdate_popup()\n```\n\n##### Permission\nIf you want to check if the user gave you a specific permission. You can just pass the key of the Cookie you defined in the config file.\n``` php\nEuCookieConsent::canIUse('key from the cookies config')\n```\n##### Scripts/Imports ...\nVery often we want to play out a specific Script Tag ... only if the user allowed us. You can define\nthe Scripts in the config of the cookie. If you use the key header for example you can render them from all of the cookies.\n``` php\n{!! EuCookieConsent::getHtml('header') !!}\n```\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email max@42coders.com instead of using the issue tracker.\n\n## Credits\n\n- [Max Hutschenreiter](https://github.com/42coders)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## Laravel Package Boilerplate\n\nThis package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42coders%2Feu-cookie-consent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F42coders%2Feu-cookie-consent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42coders%2Feu-cookie-consent/lists"}