<?php

namespace App\Http\Livewire;

use Livewire\Component;
use App\Models\User;

class Profile extends Component
{
    public $referalUrl = "", $raktveer_score = 0;
    
    public function referFriend()
    {
        $url = config('app.url') . "/refer/" . base64_encode(auth()->user()->username);
        $this->referalUrl = $url;
    }
    
    public function render()
    {
        $this->raktveer_score = User::where('referal_user', auth()->user()->username)->count();
        return view('livewire.profile');
    }
}
