PHP code example of kevupton / referrals

1. Go to this page and download the library: Download kevupton/referrals 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/ */

    

kevupton / referrals example snippets




return array(

    //prefix to each of the tables in the database
    'database_prefix' => 'ref_',

    //how many uses to pretend we have at the start.
    'start_at' => 1548,

    //the number of positions jumped when a referral is made.
    'jump_count' => 10,

    //How often to add an extra fake referral
    'addmore' => [
        'interval' => 3600, //the time between each insert
        'amount' => 1 //the amount to insert
    ]
);

//just get the refer queue with id 200
$refer_queue = ReferQueue::find(200);

//get the new position
$new_pos = $ref_queue - ref_jumps();
if ($new_pos < 0) $new_pos = 0;

$this->dispatch(new MoveInQueue($refer_queue, $new_pos));