attributes['userid'])->first(); if ($user == null) { Ip::where('id', '=', $this->attributes['id'])->delete(); return null; } else { return $user; } } public function Node() { $node = Node::where("id", $this->attributes['nodeid'])->first(); if ($node == null) { Ip::where('id', '=', $this->attributes['id'])->delete(); return null; } else { return $node; } } public function ip() { return str_replace("::ffff:", "", $this->attributes['ip']); } }