1. Go to this page and download the library: Download tlsgroup/laravel-referral 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/ */
use TLSGROUP\LaravelReferral\Traits\Referrable;
class User extends Model
{
use Referrable;
}
use Illuminate\Support\Facades\Auth;
$user = Auth::user();
$referrer = $user->referralAccount->referrer;
use TLSGROUP\LaravelReferral\Models\Referral;
use Illuminate\Support\Facades\Cookie;
$referralCode = Cookie::get(config('referral.cookie_name'));
$referrer = Referral::userByReferralCode($referralCode);
$user->hasReferralAccount();
$user->createReferralAccount($referrer->id);
$referrals = $user->referrals;
$referralLink = $user->getReferralLink();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.