A companion repo for "How to A/B test new features in PHP using Feature Flags and Amplitude
This sample PHP app uses the Laravel framework and its default Blade templating engine on the frontend. It is a demo e-commerce website page showing a list of products. It is used to demonstrate how to conduct an A/B test experiment by comparing how well the variation state (Shown on the right) performs compared to the control state (Shown on the left). The aim of the test is to determine if showing the price of the product would increase the number of clicks on the View More button. See the screenshot below.
Clicking on the View More button under the product logs an event to Amplitude. These events are then recorded in an analysis chart for later comparison to the benchmark metrics collected for the control state.
- Composer version 2 - a tool for managing dependencies in PHP
- Node version 16+
- NPM version 8+ - a package manager for setting up and building the frontend
- PHP
1. Clone the this repository.
2. Run the following command to install the PHP's dependencies.
composer install
3. Compile the frontend with NPM using the following command.
npm run dev
4. Start the PHP server with this command:
php artisan serve
You should now be able to see the app by visiting http://127.0.0.1:8000/.
Useful links to technical resources.
- PHP Documentation - learn about PHP.
ConfigCat also supports many other frameworks and languages. Check out the full list of supported SDKs here
You can also explore other code samples for various languages, frameworks, and topics here in the ConfigCat labs on GitHub.
Keep up with ConfigCat on Twitter, Facebook, LinkedIn, and GitHub.
Contributions are welcome!