abrouter/laravel-abtest
Laravel A/B testing package from Abrouter for creating experiments, splitting users into variants, and tracking conversions with a simple facade. Integrates with Abrouter for feature flags, targeting, and analytics.
Architecture fit
abrouter/laravel-abtest is a thin Laravel client for ABRouter, a hosted (or self-hostable) A/B testing and feature-flag control plane. Architecturally it is a control-plane/data-plane split: experiment configuration and statistical analysis live in ABRouter, while bucketing decisions are consumed inside the Laravel app at request time. That model fits Laravel well — server-rendered Blade views, middleware, jobs, and API responses can all branch on either a flag state or an experiment variant.
For a TPM the real architectural question is not "does it integrate" (it will — it's a Composer package with a service provider and facade) but "where do we draw the boundary." The package is designed to be called from controllers, Blade, and services directly via facades and directives. That is convenient but couples business logic to a third-party SDK. The sound pattern is to wrap ABRouter behind an internal FeatureFlags / ExperimentService interface so the rest of the codebase never imports the vendor namespace. Treat ABRouter as one provider behind that interface, not as the interface itself.
Integration feasibility
Low-to-moderate. Typical integration is:
composer require abrouter/laravel-abtestAuth::id(), but must be stable and consistent across web, queue, and API contexts)That is realistically a day of work for a competent Laravel developer for a single experiment, not the "10 minutes" the README markets (which excludes account provisioning, user-ID strategy, and analytics wiring).
Technical risk
Key questions to resolve before committing
Stack fit
Strong for a conventional Laravel monolith (Laravel 8–12, PHP 8.1+ — verify the exact composer.json constraints against our pinned version). Fits less naturally for a service-oriented architecture where flags are also needed by non-PHP services (Node workers, Go microservices); those would each need their own ABRouter SDK, multiplying the identity and consistency problem. If the platform is Laravel-heavy, the fit is good; if polyglot, ABRouter becomes one more vendor surface to standardize.
Migration path
ExperimentGate interface with two implementations: a NullGate (always control/off) and an ABRouterGate. Ship with NullGate in production so nothing depends on the vendor until explicitly enabled.ABRouterGate, enabled via config. Measure evaluation latency and failure rate.Compatibility
Coexists cleanly with Laravel Pennant if the teams are disciplined: Pennant for static, deploy-time, developer-owned flags; ABRouter for product-manager-owned, dynamically targeted flags and experiments. Running both for the same flag is a guaranteed source of confusion and should be banned by convention.
Sequencing
The critical path runs through legal, not engineering. Start GPL review in week 1 in parallel with a two-day technical spike. Do not let the spike's success create organizational momentum that overrides the license decision — a common failure mode with convenient developer tools.
Maintenance
Package maintenance is light (Composer update + occasional config changes). The heavier maintenance is experiment hygiene: stale flags accumulating, experiments left running past significance, and targeting rules that no one remembers authoring. Budget for a flag lifecycle policy (owner, expiry date, cleanup on rollout) from day one, or the flag inventory becomes technical debt within two quarters. If self-hosting ABRouter, add infrastructure maintenance for the core service, its database, and backups.
Support
The free cloud tier effectively means community/GitHub support with no SLA. For a revenue-affecting experiment platform, decide in advance whether a paid tier is budgeted; if not, accept that an outage is a "we wait" scenario rather than a "we escalate" one.
Scaling
Evaluation throughput scales well because bucketing is deterministic and cacheable; the API call is the bottleneck, not the compute. Ensure the package's cache is enabled and sized appropriately and that cache invalidation on flag changes is acceptable (some staleness is normally fine; for kill-switch flags it is not). Exposure event logging is the second scaling concern — high-traffic endpoints generating exposure events per request can produce significant write volume and should be sampled or batched.
Failure modes to design for explicitly
fail_open / fail_closed policy, defaulting to the safe variant (typically control).Ramp-up
Developer ramp-up is genuinely short — a few hours to first flag, a day to production quality. Product-manager ramp-up on the ABRouter dashboard and experiment design (metric definition, sample size, guardrail selection) is the longer curve and is not solved by the package. If the team lacks experimentation discipline, the tool will produce confidently wrong conclusions. Pair adoption with a short internal playbook on experiment design and a review step before any experiment is launched.
How can I help you explore Laravel packages today?