简体   繁体   中英

error auth dependency when using IoC Container injection

I'm using IoC Container injection in my controller and when i use MultiAuth package. like this:

<?php namespace Controllers\MyNameSpace;

use Ollieread\MultiAuth\AuthManager as Auth;

class AuthUserController extends BaseController
{

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

    public function getIndex()
    {
        if ( $this->auth->user()->check()) {
            return Redirect::to('/');
        }

        return 'NOoOo ...';
    }

i recieve this error:

Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Ollieread\\MultiAuth\\AuthManager

不需要通过IoC进行负载,这有点违背了立面系统的目的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM