Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand All @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at graham@alt-three.com. All
reported by contacting the project team at yo@7span.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
6 changes: 0 additions & 6 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,3 @@ If you discover a security vulnerability within this package, please send an
email to one the security contacts. All security vulnerabilities will be
promptly addressed. Please do not disclose security-related issues publicly
until a fix has been announced.

### Security Contacts

* James Brooks (james@alt-three.com)
* Graham Campbell (graham@alt-three.com)
* Joe Cohen (joe@alt-three.com)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2020 Alt Three Services Limited
Copyright (c) Spatie bvba <info@spatie.be>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
27 changes: 6 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
![Alt Three Segment](https://user-images.githubusercontent.com/2829600/71490849-0de16e00-2825-11ea-87a6-ddada0f35224.png)

<p align="center">
<a href="https://github.com/AltThree/Segment/actions?query=workflow%3ATests"><img src="https://img.shields.io/github/workflow/status/AltThree/Segment/Tests?label=Tests&style=flat-square" alt="Build Status"></img></a>
<a href="https://github.styleci.io/repos/38056197"><img src="https://github.styleci.io/repos/38056197/shield" alt="StyleCI Status"></img></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen?style=flat-square" alt="Software License"></img></a>
<a href="https://packagist.org/packages/alt-three/segment"><img src="https://img.shields.io/packagist/dt/alt-three/segment?style=flat-square" alt="Packagist Downloads"></img></a>
<a href="https://github.com/AltThree/Segment/releases"><img src="https://img.shields.io/github/release/AltThree/Segment?style=flat-square" alt="Latest Version"></img></a>
</p>


## Installation

Alt Three Segment is a [Segment](https://segment.com/) bridge for Laravel. This version requires [PHP](https://php.net) 7.1-7.4, and supports Laravel 5.5-8. Simply require the package using [Composer](https://getcomposer.org):
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):

```bash
$ composer require alt-three/segment:^3.5
$ composer require sevenspan/segment-php-sdk:^1.0
```

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

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

Alt Three Segment requires configuration.
SevenSpan Segment requires configuration.

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

Expand All @@ -32,7 +20,6 @@ $ 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

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`.
Expand Down Expand Up @@ -61,12 +48,10 @@ Segment::track([
]);
```


## Security

Our full security policy is available to read [here](https://github.com/AltThree/Segment/security/policy).

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

## License

Alt Three Segment is licensed under [The MIT License (MIT)](LICENSE).
SevenSpan Segment is licensed under [The MIT License (MIT)](LICENSE).
108 changes: 66 additions & 42 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,69 @@
{
"name": "alt-three/segment",
"description": "A Segment bridge for Laravel",
"keywords": ["segment", "bridge", "segment.com", "segment.io", "api", "Alt Three"],
"license": "MIT",
"authors": [
{
"name": "Alt Three",
"email": "support@alt-three.com"
}
],
"require": {
"php": "^7.1.3",
"illuminate/config": "^5.5 || ^6.0 || ^7.0 || ^8.0",
"illuminate/support": "^5.5 || ^6.0 || ^7.0 || ^8.0",
"segmentio/analytics-php": "~1.5.2"
"name": "sevenspan/segment-php-sdk",
"description": "A Segment bridge for Laravel",
"keywords": [
"segment",
"analytics",
"php8.1",
"laravel9",
"data-analytics",
"bridge",
"segment.com",
"segment.io",
"api"
],
"license": "MIT",
"authors": [
{
"name": "Hemratna Bhimani",
"email": "hemratna.bhimani@gmail.com",
"homepage": "https://github.com/7span/segment-php-sdk",
"role": "Developer"
},
"require-dev": {
"graham-campbell/analyzer": "^2.4 || ^3.0",
"graham-campbell/testbench": "^5.5",
"phpunit/phpunit": "^6.5 || ^7.5 || ^8.4 || ^9.0"
{
"name": "Binal Gajjar",
"email": "binal.gajjar7@gmail.com",
"homepage": "https://github.com/7span/segment-php-sdk",
"role": "Developer"
},
"autoload": {
"psr-4": {
"AltThree\\Segment\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"AltThree\\Tests\\Segment\\": "tests/"
}
},
"config": {
"preferred-install": "dist"
},
"extra": {
"laravel": {
"providers": [
"AltThree\\Segment\\SegmentServiceProvider"
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
{
"name": "Kajal Pandya",
"email": "kjlkajal98@gmail.com",
"homepage": "https://github.com/7span/segment-php-sdk",
"role": "Developer"
}
],
"require": {
"php": "^8.1.0||^8.2",
"illuminate/config": "^9.0|^10.0|^11.0",
"illuminate/support": "^9.0|^10.0|^11.0",
"segmentio/analytics-php": "~3.5.0 || ^3.7.0 || ^3.8.0"
},
"require-dev": {
"graham-campbell/analyzer": "^2.4 || ^3.0 || ^3.1 || ^4.0 || ^4.1",
"graham-campbell/testbench": "^5.5 || ^6.0",
"phpunit/phpunit": "^6.5 || ^7.5 || ^8.4 || ^9.0 || ^10.0 || ^11.0"
},
"autoload": {
"psr-4": {
"SevenSpan\\Segment\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"SevenSpan\\Tests\\Segment\\": "tests/"
}
},
"config": {
"preferred-install": "dist"
},
"extra": {
"laravel": {
"providers": [
"SevenSpan\\Segment\\SegmentServiceProvider"
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
9 changes: 0 additions & 9 deletions config/segment.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

declare(strict_types=1);

/*
* This file is part of Alt Three Segment.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

return [

/*
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
verbose="true"
>
<testsuites>
<testsuite name="Alt Three Segment Test Suite">
<testsuite name="SevenSpan Segment Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
Expand Down
20 changes: 4 additions & 16 deletions src/SegmentServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,21 @@

declare(strict_types=1);

/*
* This file is part of Alt Three Segment.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace AltThree\Segment;
namespace SevenSpan\Segment;

use Illuminate\Foundation\Application as LaravelApplication;
use Illuminate\Support\ServiceProvider;
use Laravel\Lumen\Application as LumenApplication;
use Segment;
use Segment\Segment;

/**
* This is the segment service provider class.
*
* @author Graham Campbell <graham@alt-three.com>
*/
class SegmentServiceProvider extends ServiceProvider
{
/**
* Boot the service provider.
*
* @return void
*/

public function boot()
{
$this->setupConfig();
Expand All @@ -46,6 +33,7 @@ public function boot()
*
* @return void
*/

protected function setupConfig()
{
$source = realpath($raw = __DIR__.'/../config/segment.php') ?: $raw;
Expand Down
16 changes: 1 addition & 15 deletions tests/AnalysisTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,12 @@

declare(strict_types=1);

/*
* This file is part of Alt Three Segment.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace AltThree\Tests\Segment;
namespace SevenSpan\Tests\Segment;

use GrahamCampbell\Analyzer\AnalysisTrait;
use Laravel\Lumen\Application;
use PHPUnit\Framework\TestCase;

/**
* This is the analysis test class.
*
* @author Graham Campbell <graham@alt-three.com>
*/
class AnalysisTest extends TestCase
{
use AnalysisTrait;
Expand Down
18 changes: 2 additions & 16 deletions tests/ServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,12 @@

declare(strict_types=1);

/*
* This file is part of Alt Three Segment.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SevenSpan\Tests\Segment;

namespace AltThree\Tests\Segment;

use AltThree\Segment\SegmentServiceProvider;
use SevenSpan\Segment\SegmentServiceProvider;
use GrahamCampbell\TestBench\AbstractPackageTestCase;
use GrahamCampbell\TestBenchCore\ServiceProviderTrait;

/**
* This is the service provider test class.
*
* @author Graham Campbell <graham@alt-three.com>
*/
class ServiceProviderTest extends AbstractPackageTestCase
{
use ServiceProviderTrait;
Expand Down