PHP code example of brycematheson / laravel_ab_test

1. Go to this page and download the library: Download brycematheson/laravel_ab_test library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

brycematheson / laravel_ab_test example snippets


Abtest::pageView()

// get the underlying model
Abtest::getExperiment()

// get the experiment name
Abtest::getExperiment()->name

// get the visitor count
Abtest::getExperiment()->visitors

public function index(Request $request) {
    // the same as 'Abtest::getExperiment()'
    $request->abExperiment()
}

Abtest::completeGoal('signup')

Abtest::getCompletedGoals()
bash
php artisan vendor:publish --provider="Brycematheson\Abtest\AbtestServiceProvider"
bash
php artisan migrate
bash
php artisan ab:report
bash
php artisan ab:reset