Skip to content

Commit 986ef97

Browse files
authored
Merge pull request #13 from maloun96/identify
feat(identify): add identify method
2 parents 0e251d7 + a13a9ab commit 986ef97

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

.github/workflows/run-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
4141
- name: Install dependencies
4242
run: |
43+
composer config --no-plugins allow-plugins.pestphp/pest-plugin true
44+
composer config --no-plugins allow-plugins.phpstan/extension-installer true
4345
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
4446
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4547

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@
5454
"test-coverage": "vendor/bin/pest --coverage"
5555
},
5656
"config": {
57-
"sort-packages": true
57+
"sort-packages": true,
58+
"allow-plugins": {
59+
"pestphp/pest-plugin": true,
60+
"phpstan/extension-installer": true
61+
}
5862
},
5963
"extra": {
6064
"laravel": {

src/Facades/LaravelSegment.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/**
99
* @see \BinarCode\LaravelSegment\LaravelSegmentManager
1010
* @method static void alias(string $previousId, string $userId)
11+
* @method static void identify(string $userId, array $data)
1112
* @method static SegmentPayload track(string|array|SegmentPayload $payload, array $options = [])
1213
*/
1314
class LaravelSegment extends Facade

src/LaravelSegmentManager.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,12 @@ public function alias(string $previousId, string $userId): void
3737
'userId' => $userId,
3838
]);
3939
}
40+
41+
public function identify(string $userId, array $data)
42+
{
43+
Segment::identify(array(
44+
"userId" => $userId,
45+
"traits" => $data
46+
));
47+
}
4048
}

0 commit comments

Comments
 (0)