diff --git a/composer.json b/composer.json index d41429f5..d53eccf5 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ ], "require": { "php": ">=5.4.0", - "twig/twig": "~1.15|~2.0", + "twig/twig": "1.30.0", "illuminate/support": "5.0.*|5.1.*|5.2.*|5.3.*", "illuminate/view": "5.0.*|5.1.*|5.2.*|5.3.*" }, diff --git a/src/Extension/Laravel/Auth.php b/src/Extension/Laravel/Auth.php index fffa0783..a83f3f70 100644 --- a/src/Extension/Laravel/Auth.php +++ b/src/Extension/Laravel/Auth.php @@ -24,6 +24,7 @@ class Auth extends Twig_Extension * @var \Illuminate\Auth\AuthManager */ protected $auth; + protected $guard; /** * Create a new auth extension. @@ -33,6 +34,7 @@ class Auth extends Twig_Extension public function __construct(AuthManager $auth) { $this->auth = $auth; + $this->guard = $this->auth->guard(); } /** @@ -51,7 +53,7 @@ public function getFunctions() return [ new Twig_SimpleFunction('auth_check', [$this->auth, 'check']), new Twig_SimpleFunction('auth_guest', [$this->auth, 'guest']), - new Twig_SimpleFunction('auth_user', [$this->auth, 'user']), + new Twig_SimpleFunction('auth_user', [$this->guard, 'user']), new Twig_SimpleFunction('auth_guard', [$this->auth, 'guard']), ]; }