Pergunta

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;
Foi útil?

Solução

You need Fully qualified name, add a backslash:

\Auth::check();

It all described as Namepace resolution.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top