xmaestro
xmaestro

Reputation: 1104

Laravel 4 : Unable to access Auth instance inside package class

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;

Upvotes: 0

Views: 62

Answers (1)

egig
egig

Reputation: 4430

You need Fully qualified name, add a backslash:

\Auth::check();

It all described as Namepace resolution.

Upvotes: 1

Related Questions