Support the ongoing development of Laravel.io →
posted 9 years ago
Architecture
Last updated 2 years ago.
0

You can use the \Auth.

0

yes, but i looking for much more dynamic solution.

0

You can do it in two ways.

First:

<?php
namespace App\Controller;

class FooController
{
    public function doAction()
    {
        $auth = \Auth::login();
    }
}

Second:

<?php
namespace App\Controller;

use Auth;

class FooController
{
    public function doAction()
    {
        $auth = Auth::login();
    }
}
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

ksharifi ksharifi Joined 5 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.