public function amLoggedAs($user, $driver = null)
    {
        if ($user instanceof Authenticatable) {
            $this->app['auth']->driver($driver)->setUser($user);
        } else {
            $this->app['auth']->driver($driver)->attempt($user);
        }
    }
public function amLoggedAs($user, $driver = null)
    {
        if ($user instanceof Authenticatable) {
            $this->app['auth']->driver($driver)->setUser($user);
        } else {
            $this->app['auth']->driver($driver)->attempt($user);
        }
    }
public function amLoggedAs ( $ user , $ driver = null ) { if ( $ user instanceof Authenticatable ) { $ this -> app [ 'auth' ] -> driver ( $ driver ) -> setUser ( $ user ) ; } else { $ this -> app [ 'auth' ] -> driver ( $ driver ) -> attempt ( $ user ) ; } }
Set the currently logged in user for the application.
Takes either an object that implements the User interface or
an array of credentials.

@param  \Illuminate\Contracts\Auth\User|array $user
@param  string $driver
@return void
Set the currently logged in user for the application . Takes either an object that implements the User interface or an array of credentials .