简体   繁体   中英

Lumen 5.1 Auth::attempt Not working

I am using lumen 5.1.* but whenever i use Auth it will throw an error

ErrorException in AuthManager.php line 16: Missing argument 1 for Illuminate\\Auth\\AuthManager::createDriver(), called in D:\\xampp\\htdocs\\project\\vendor\\illuminate\\support\\Manager.php on line 87 and defined

Can any one help me how to fix this issue .I need to use Auth::user() in lumen

public function postLogin(Request $request){


       if (Auth::attempt(['email' => $request->email, 'password' => $request->password])) {
            // Authentication passed...
            echo "success";
            echo "<pre>";
            print_r(Auth::user()->toArray());
        } else {
            echo "sorry erorr occured";
        }
    }

settings your .env file then check

lumen-api-oauth/.env.example

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