{"id":21008395,"url":"https://github.com/binarcode/laravel-segment","last_synced_at":"2025-05-15T02:32:16.974Z","repository":{"id":41882450,"uuid":"467463363","full_name":"BinarCode/laravel-segment","owner":"BinarCode","description":"A Laravel wrapper for the Segment API and events tracking. ","archived":false,"fork":false,"pushed_at":"2023-10-23T03:38:46.000Z","size":87,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-08-09T21:19:49.939Z","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/BinarCode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null},"funding":{"github":"binarcode"}},"created_at":"2022-03-08T10:23:49.000Z","updated_at":"2024-08-09T21:19:49.940Z","dependencies_parsed_at":"2023-02-16T03:16:02.203Z","dependency_job_id":null,"html_url":"https://github.com/BinarCode/laravel-segment","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":"spatie/package-skeleton-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinarCode%2Flaravel-segment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinarCode%2Flaravel-segment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinarCode%2Flaravel-segment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinarCode%2Flaravel-segment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BinarCode","download_url":"https://codeload.github.com/BinarCode/laravel-segment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225324132,"owners_count":17456460,"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":[],"created_at":"2024-11-19T09:12:25.398Z","updated_at":"2024-11-19T09:12:25.990Z","avatar_url":"https://github.com/BinarCode.png","language":"PHP","funding_links":["https://github.com/sponsors/binarcode"],"categories":[],"sub_categories":[],"readme":"# A Laravel wrapper for the Segment API and events tracking.\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/binarcode/laravel-segment.svg?style=flat-square)](https://packagist.org/packages/binarcode/laravel-segment)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/binarcode/laravel-segment/run-tests?label=tests)](https://github.com/binarcode/laravel-segment/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/binarcode/laravel-segment/Check%20\u0026%20fix%20styling?label=code%20style)](https://github.com/binarcode/laravel-segment/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/binarcode/laravel-segment.svg?style=flat-square)](https://packagist.org/packages/binarcode/laravel-segment)\n\nSegment simplifies the process of collecting data and connecting new tools, allowing you to spend more time using your data, and less time trying to collect it. You can use Segment to track events that happen when a user interacts with the interfaces. “Interfaces” is Segment’s generic word for any digital properties you own: your website, mobile apps, and processes that run on a server or OTT device.\n\n### [Official documentation](https://segment.com/docs)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require binarcode/laravel-segment\n```\n\nYou can publish and run the migrations with:\n\n```bash\nphp artisan vendor:publish --tag=\"segment-migrations\"\nphp artisan migrate\n```\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --tag=\"segment-config\"\n```\n\nThis is the contents of the published config file:\n\n```php\nreturn [\n    /**\n     * The queue name where the segment events will be dispatched.\n     */\n    'queue' =\u003e env('SEGMENT_QUEUE', env('QUEUE_CONNECTION', 'sync')),\n\n    /**\n     * Segment API key [see: https://segment.com/docs/connections/sources/catalog/libraries/server/php/#identify].\n     */\n    'key' =\u003e env('SEGMENT_KEY', ''),\n];\n```\n\n## Usage\n\n### Track event \n\n```php\nBinarCode\\LaravelSegment\\Facades\\LaravelSegment::track('click')-\u003eproperties([...])\n```\n\n### Alias anonymous id to a real user id\n```php\nBinarCode\\LaravelSegment\\Facades\\LaravelSegment::alias($previous, $userId);\n```\n### The Segment Identify\n```php\nBinarCode\\LaravelSegment\\Facades\\LaravelSegment::identify($userId, $data);\n```\nThe Segment Identify call lets you tie a user to their actions and record traits about them. It includes a unique User ID and any optional traits you know about the user, like their email, name, and more.\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Eduard Lupacescu](https://github.com/binaryk)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarcode%2Flaravel-segment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinarcode%2Flaravel-segment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarcode%2Flaravel-segment/lists"}