Download the PHP package jeffersongoncalves/laravel-segment without Composer
On this page you can find all versions of the php package jeffersongoncalves/laravel-segment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeffersongoncalves/laravel-segment
More information about jeffersongoncalves/laravel-segment
Files in jeffersongoncalves/laravel-segment
Package laravel-segment
Short Description Laravel client for the Segment HTTP API: track events, identify users, record page views, send batches, and read Personas profile traits and events.
License MIT
Homepage https://github.com/jeffersongoncalves/laravel-segment
Informations about the package laravel-segment
Laravel Segment
A Laravel client for Segment's HTTP API: track events, identify users, record page views, send batches, and read Personas profile traits and events through a simple, typed API built on Laravel's Http client.
This is a server-side API client only — no JS SDK, no Blade snippet.
Features
- Tracking API:
track,identify,page,batch - Profile API (Personas):
profileTraits,profileEvents - Throws
InvalidArgumentExceptionwhen the credentials a call requires are missing
Installation
You can install the package via composer:
Publish the config file:
Set your Segment credentials in .env:
The write key authenticates the Tracking API (track, identify, page, batch) — find it under your source's Settings > API Keys. The access token and space ID authenticate the Profile API (profileTraits, profileEvents) — create one under Unify/Personas > Settings > API Access.
Configuration
Usage
The package is resolved via the Segment facade or by injecting JeffersonGoncalves\Segment\Segment.
Track an event
Identify a user
Record a page view
Send a batch
Each message carries its own type alongside its payload. Segment caps a batch request at 500KB.
Read profile traits and events
The space ID falls back to segment.space_id, and can be overridden per call:
Error handling
Calling a method without the credentials it requires throws InvalidArgumentException:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome. Please open an issue or pull request on GitHub.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Jefferson Gonçalves
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-segment with dependencies
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
spatie/laravel-package-tools Version ^1.16