Download the PHP package synchro/segment without Composer
On this page you can find all versions of the php package synchro/segment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download synchro/segment
More information about synchro/segment
Files in synchro/segment
Informations about the package segment
This package is a Segment bridge for Laravel, which relies on Segment's own PHP library. This version requires PHP 8.1 and up, and supports Laravel 9 – 10. This package was originally written by Graham Campbell for Alt Three, but was abandoned in April 2022. This fork was resurrected in April 2023 by Marcus Bointon (@Synchro).
Installation
Install the package using Composer:
Once installed, if you are not using automatic package discovery, then you need to register the Synchro\Segment\SegmentServiceProvider
service provider in your config/app.php
.
Configuration
Segment requires configuration.
To get started, you'll need to publish all vendor assets:
This will create a config/segment.php
file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.
Usage
Once you've set your write_key
value in the configuration, you're ready to go! For the most part you can follow Segment's own instructions however, you'll want to replace the Analytics
classname with Segment
- plus, you don't need to call class_alias
.
Identify the user
Track actions
Tests
Run tests with ./vendor.bin/phpunit
or composer test
.
Coding standards
Coding standards are checked and enforced using Tighten's Duster package using the default Laravel coding standard. Check for coding standards issues by running ./vendor/bin/duster lint
, and apply automatic fixes using ./vendor/bin/duster fix
, or composer cs
. These checks are also run using GitHub actions.
Security
Our security policy is available to read here.
License
This library is licensed under The MIT License (MIT).
All versions of segment with dependencies
illuminate/config Version ^9.0 || ^10.0
illuminate/support Version ^9.0 || ^10.0
segmentio/analytics-php Version ^3.6.0