PHPackages                             sevenspan/segment-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sevenspan/segment-php-sdk

ActiveLibrary[API Development](/categories/api)

sevenspan/segment-php-sdk
=========================

A Segment bridge for Laravel

v2.0(2y ago)02.5kMITPHPPHP ^8.1.0||^8.2

Since Jan 11Pushed 1y agoCompare

[ Source](https://github.com/7span/segment-php-sdk)[ Packagist](https://packagist.org/packages/sevenspan/segment-php-sdk)[ RSS](/packages/sevenspan-segment-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (5)Used By (0)

Installation
------------

[](#installation)

SevenSpan Segment is a [Segment](https://segment.com/) bridge for Laravel. This version requires [PHP](https://php.net) 8.2, and supports Laravel 9 and 10. Simply require the package using [Composer](https://getcomposer.org):

```
$ composer require sevenspan/segment-php-sdk:^1.0
```

Once installed, if you are not using automatic package discovery, then you need to register the `SevenSpan\SegmentPhpSdk\SegmentServiceProvider` service provider in your `config/app.php`.

Configuration
-------------

[](#configuration)

SevenSpan Segment requires configuration.

To get started, you'll need to publish all vendor assets:

```
$ php artisan vendor:publish
```

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
-----

[](#usage)

Once you've set your `write_key` value in the configuration, you're ready to go! For the most part you can follow [Segments own instructions](https://segment.com/docs/libraries/php/quickstart) however, you'll want to replace the `Analytics` classname with `Segment` - plus, you don't need to call `class_alias`.

### Identify the user

[](#identify-the-user)

```
Segment::identify([
    'userId' => '12345abcde',
    'traits' => [
        'name' => 'James Brooks',
        'email' => 'test@test.com',
    ],
]);
```

### Track actions

[](#track-actions)

```
Segment::track([
    'userId' => '12345abcde',
    'event' => 'Did something',
    'properties' => [
        'was_awesome' => true,
    ],
]);
```

Security
--------

[](#security)

Our full security policy is available to read [here](https://github.com/7span/segment-php-sdk/security/policy).

License
-------

[](#license)

SevenSpan Segment is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 78.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~221 days

Total

3

Last Release

782d ago

Major Versions

v1.1 → v2.02024-03-28

PHP version history (2 changes)v1.0PHP ^8.1.0

v1.1PHP ^8.1.0||^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/08bf8e5911bd55b6328d8e1a32c786000dc7023bc741cbad255a2625ed91a75b?d=identicon)[hemratna](/maintainers/hemratna)

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (90 commits)")[![kajal-7span](https://avatars.githubusercontent.com/u/107455736?v=4)](https://github.com/kajal-7span "kajal-7span (14 commits)")[![binal-7span](https://avatars.githubusercontent.com/u/19200178?v=4)](https://github.com/binal-7span "binal-7span (5 commits)")[![jbrooksuk](https://avatars.githubusercontent.com/u/246103?v=4)](https://github.com/jbrooksuk "jbrooksuk (3 commits)")[![coquer](https://avatars.githubusercontent.com/u/1929689?v=4)](https://github.com/coquer "coquer (1 commits)")[![danrovito](https://avatars.githubusercontent.com/u/8322674?v=4)](https://github.com/danrovito "danrovito (1 commits)")[![trushal-7span](https://avatars.githubusercontent.com/u/102795093?v=4)](https://github.com/trushal-7span "trushal-7span (1 commits)")

---

Tags

apiBridgeanalyticssegmentiosegmentlaravel9php81segment.comdata-analytics

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sevenspan-segment-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/sevenspan-segment-php-sdk/health.svg)](https://phpackages.com/packages/sevenspan-segment-php-sdk)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[ozankurt/google-analytics

Laravel Google Analytics

7616.7k](/packages/ozankurt-google-analytics)[still-code/laravel-umami

Umami API wrapper for laravel

362.5k](/packages/still-code-laravel-umami)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
