Fatal error: Call to a member function clicks() on a non-object in /home/tonyspiz/public_html/inc/core/controllers/Mms.php on line 23

ErrorException:

Call to a member function clicks() on a non-object

File: /home/tonyspiz/public_html/inc/core/controllers/Mms.php: 23

Backtrace:

  1. file:
    /home/tonyspiz/public_html/inc/core/controllers/Mms.php
    line:
    23
    function:
    ErrorException
    source:
    18 
    19     }
    20     public function visit($id){
    21         /** @var Adbanner $ad */
    22         $ad = Adbanner::getById($id);
    23         $ad->clicks()->create([
    24             'adbanner_id' => $id,
    25             'time' => time(),
    26             'ip' => static::getIpAddress()
    27         ]);
    28