'datetime', ]; private $online_minutes = 15; public function city() { return $this->hasOne('App\City', 'id', 'city_id'); } public function country() { return $this->hasOne('App\Country', 'id', 'country_id'); } public function articles() { return $this->hasMany('App\Article', 'user_id', 'id')->latest(); } public function online() { $control_time = $this->online_minutes * 60; return ((time() - $this->online) > $control_time) ? false : true; } }