I'm using PHP's built-in DOMXPath() class to do some simple web-scrapping. However, it works on my 4.2 site, but not my 5.1 (both are on same installation of PHP).

Here's the error:

Class 'App\Http\Controllers\admin\DOMXPath' not found

 $list1 =newDOMXPath();

 

In Laravel 5.1 you must prefix the class name with the global namespace prefix '\'.

$list1 =new \DOMXPath();