authentication - Laravel: Dependency Inject Auth -



authentication - Laravel: Dependency Inject Auth -

how dependency inject auth in laravel?

like this:

public function __construct(auth $auth) { $this->auth = $auth; }

if not work:

$user_type = auth::user()->user_type;

you should type hint illuminate\auth\authmanager:

public function __construct(illuminate\auth\authmanager $auth) { $this->auth = $auth; }

authentication laravel laravel-4 dependency-injection

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -