{"id":19777937,"url":"https://github.com/datadome/fraud-sdk-laravel-package","last_synced_at":"2026-05-18T19:45:33.623Z","repository":{"id":222494661,"uuid":"694737886","full_name":"DataDome/fraud-sdk-laravel-package","owner":"DataDome","description":"Fraud Protection for PHP (Laravel)","archived":false,"fork":false,"pushed_at":"2024-02-14T14:12:38.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-02-14T15:29:55.770Z","etag":null,"topics":["fraud","laravel","php","sdk"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DataDome.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-09-21T15:34:45.000Z","updated_at":"2024-02-14T15:30:13.072Z","dependencies_parsed_at":"2024-02-14T15:30:11.361Z","dependency_job_id":"4e34e6e1-c250-4e9c-ba97-c45370148dd4","html_url":"https://github.com/DataDome/fraud-sdk-laravel-package","commit_stats":null,"previous_names":["datadome/fraud-sdk-laravel-package"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/DataDome/fraud-sdk-laravel-package","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDome%2Ffraud-sdk-laravel-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDome%2Ffraud-sdk-laravel-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDome%2Ffraud-sdk-laravel-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDome%2Ffraud-sdk-laravel-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataDome","download_url":"https://codeload.github.com/DataDome/fraud-sdk-laravel-package/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDome%2Ffraud-sdk-laravel-package/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269922906,"owners_count":24496999,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fraud","laravel","php","sdk"],"created_at":"2024-11-12T05:27:11.315Z","updated_at":"2026-05-18T19:45:28.603Z","avatar_url":"https://github.com/DataDome.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DataDome Fraud Protection - PHP Laravel integration\n\nModule for supporting DataDome Fraud Protection in Laravel PHP applications.\n\n## Installation\n\nThis package can be installed through composer by running the following command:\n\n```\ncomposer require datadome/fraud-sdk-laravel\n```\n\nThen proceed to run the below command to generate an autoloader containing the main class and options:\n\n```\ncomposer dump-autoload\n```\n\nWhen the above processes are completed, add the DataDomeServiceProvider to the list of ServiceProviders found in the ``config/app.php``.\nThen run ``php artisan vendor:publish`` to publish the DataDomeServiceProvider. This should publish the required ``datadome.php`` config file to the ``config`` folder.\n\n## Usage\n\nUpdate the .env files with your preferred configuration.\nPlease note that the `DATADOME_FRAUD_API_KEY` is mandatory, while the other two settings are optional.\n\n```\nDATADOME_FRAUD_API_KEY=my-datadome-fraud-api-key\nDATADOME_TIMEOUT=1500\nDATADOME_ENDPOINT='https://account-api.datadome.co'\n```\n\nTo make use of the DataDome SDK in your controller, first add the required imports:\n\n```php\nuse DataDome\\FraudSdkSymfony\\Models\\Address;\nuse DataDome\\FraudSdkSymfony\\Models\\LoginEvent;\nuse DataDome\\FraudSdkSymfony\\Models\\StatusType;\nuse DataDome\\FraudSdkSymfony\\Models\\RegistrationEvent;\nuse DataDome\\FraudSdkSymfony\\Models\\Session;\nuse DataDome\\FraudSdkSymfony\\Models\\User;\nuse DataDome\\FraudSdkSymfony\\Models\\ResponseAction;\n```\n\nThen, invoke the validate and collect methods as required:\n\n```php\nif ($this-\u003evalidateLogin(\"account_guid_to_check\")) {\n    $loginEvent = new LoginEvent(\"account_guid_to_check\", StatusType::Succeeded);\n    $loginResponse = app(\"DataDome\")-\u003evalidate($request, $loginEvent);\n\n    if ($loginResponse != null \u0026\u0026 $loginResponse-\u003eaction == ResponseAction::Allow-\u003ejsonSerialize()) {\n        // Valid login attempt\n        return response()-\u003ejson([true]);\n    } else {\n        // Business Logic here\n        // MFA\n        // Challenge\n        // Notification email\n        // Temporarily lock account\n        return response()-\u003ejson([\"Login denied\"]);\n    }\n}\nelse {\n    $loginEvent = new LoginEvent(\"account_guid_to_check\", StatusType::Failed);\n    app(\"DataDome\")-\u003ecollect($request, $loginEvent);\n}\n\nreturn response()-\u003ejson([false]);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadome%2Ffraud-sdk-laravel-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadome%2Ffraud-sdk-laravel-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadome%2Ffraud-sdk-laravel-package/lists"}