Welcome Guest, Not a member yet? Register   Sign In
Post Visit CounterWith Ip
#3

Something like this:

PHP Code:
        $ipTableModel = new App\Models\IpTableModel();
        $ip_address $this->request->getIPAddress();
        $countResult $ipTableModel->where('ip_address'$ip_address)
            ->countAllResults();
        if($countResult == 0){
            $ipTableModel->insert([
                'ip_address' => $ip_address,
                'visits' => 1
            
]);
        }else{
            $ipTableModel->where('ip_address'$ip_address)
                ->increment('visits');
        
Reply


Messages In This Thread
Post Visit CounterWith Ip - by thedragon655 - 01-17-2021, 03:44 PM
RE: Post Visit CounterWith Ip - by InsiteFX - 01-18-2021, 03:28 AM
RE: Post Visit CounterWith Ip - by AndresHDZ - 01-18-2021, 07:02 AM
RE: Post Visit CounterWith Ip - by thedragon655 - 01-19-2021, 07:29 AM
RE: Post Visit CounterWith Ip - by AndresHDZ - 01-19-2021, 08:30 AM
RE: Post Visit CounterWith Ip - by paliz - 01-19-2021, 12:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB