Skip to content

Commit cb329b0

Browse files
author
ziming
committed
change method name
1 parent 6cb8f57 commit cb329b0

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ LaravelStatsig::checkGate($user, 'gate_name');
9999

100100
// You can set add this to your ServiceProvider boot() method to
101101
// override the default laravel user to Statsig user conversion code too if you want
102-
LaravelUserToStatsigUserConverter::setConversionCallback(function (User $laravelUser): StatsigUser {
102+
LaravelUserToStatsigUserConverter::setConversionCallable(function (User $laravelUser): StatsigUser {
103103
$statsigUser = StatsigUser::withUserID((string) $laravelUser->getAuthIdentifier());
104104
$statsigUser->setEmail($laravelUser->getEmailForVerification());
105-
$statsigUser->setStatsigEnvironment([App::environment()]);
106105
$statsigUser->setIP(request()->ip());
107106
$statsigUser->setLocale(App::currentLocale());
108107
$statsigUser->setUserAgent(request()->userAgent());
109-
$statsigUser->setCountry('US');
108+
109+
// $statsigUser->setCountry('US');
110110

111111
return $statsigUser;
112112
});

src/Utils/LaravelUserToStatsigUserConverter.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,22 @@ public static function defaultConvert(Authenticatable|User $laravelUser): Statsi
2222
);
2323

2424
$statsigUser->setEmail($laravelUser->getEmailForVerification());
25-
$statsigUser->setStatsigEnvironment([App::environment()]);
2625
$statsigUser->setIP(request()->ip());
2726

28-
// What are the difference between current locale and get locale?
27+
// What is the difference between current locale and get locale?
2928
// $statsigUser->setLocale(App::currentLocale());
3029
$statsigUser->setLocale(App::currentLocale());
3130

3231
// are these set automatically? can i remove?
33-
$statsigUser->setUserAgent(request()->userAgent());
32+
$statsigUser->setUserAgent(
33+
request()
34+
->userAgent()
35+
);
3436

3537
return $statsigUser;
3638
}
3739

38-
public static function setConversionCallback(callable $callable): void
40+
public static function setConversionCallable(callable $callable): void
3941
{
4042
if (! is_callable($callable)) {
4143
throw new InvalidArgumentException('This is not a callable');

0 commit comments

Comments
 (0)