/** * @param $instance_id * @return bool */ public function ownsInstance($instance_id) { return (bool) User::instances()->where('instance_id', '=', $instance_id)->where('owner', '=', 1)->count(); }