Question

I have this class in a workbench package:

class SomeClass{

//Constructor
function __construct(){

    $isAuth = Auth::check();   

    }   

But it gives me following error:

Class 'vendor\pachage\Auth' not found 

Is this a namespace issue? I am using the following namespace:

namespace vendor\pachage;
Was it helpful?

Solution

You need Fully qualified name, add a backslash:

\Auth::check();

It all described as Namepace resolution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top