File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -75,19 +75,26 @@ return [
7575use Illuminate\Foundation\Auth\User;
7676use Statsig\StatsigUser;
7777use Ziming\LaravelStatsig\Utils\LaravelUserToStatsigUserConverter;
78+ use Ziming\LaravelStatsig\LaravelStatsigEvent;
79+
7880$laravelStatsig = new Ziming\LaravelStatsig();
7981
8082// The Facade Version is fine too
8183LaravelStatsig::checkGate($user, '<gate _name >');
8284
83- // You can set add this to your AppServiceProvider boot() method to
85+ // You can set add this to your ServiceProvider boot() method to
8486// override the default laravel user to Statsig user conversion code too if you want
8587LaravelUserToStatsigUserConverter::setLaravelUserToStatsigUserConversionCallback(function (User $laravelUser): StatsigUser {
8688 $statsigUser = StatsigUser::withUserID($laravelUser->getAuthIdentifier());
8789 $statsigUser->setCountry('US');
8890
8991 return $statsigUser;
9092});
93+
94+ // Lastly you can also use LaravelStatsigEvent instead of StatsigEvent
95+ // as it accepts a laravel user object
96+ $statsigEvent = new LaravelStatsigEvent('event-name');
97+ $statsigUser->setUser(Auth::user());
9198```
9299
93100## Testing
You can’t perform that action at this time.
0 commit comments