Laravel Pennant decides who gets a feature. An A/B test also needs to know who saw it, who converted, and whether the difference is real. Laravel Pennant Experiments adds that layer. It is an unofficial community package [1].
Define an experiment
An experiment is a Pennant feature whose value is the variant:
Experiments :: define ( 'checkout-button' , [ 'control' => 50 , 'green' => 50 ] ) ;
Enter fullscreen mode
Exit fullscreen mode
Two variants or ten, with whole-number weights; the first is the control.
Users, teams or guests get a sticky variant.
Exposure is recorded with expose() or @variant ; conversions with Experiments::convert() or JavaScript.
What the results check
Two-proportion z-test with a confidence interval for the difference
Bayesian probability to beat control
Wilson intervals and a Bonferroni correction for several challengers
A minimum-data rule, and "Keep running" until the planned sample is reached
Safety and limits
Bots and requests with DNT or GPC get the control and are…