Update Resource.php

Added namespace support for create new "rest" objects without errors.