简体   繁体   中英

Laravel Login with outside data

I'm using laravel. I know it has a functionality to do login really easy. But, as far as I know it just work with the laravel database. However, I have the database outside of my server so I am using an API to get everything I need. My question is how can I still use the Authentication function using my API?

It is really easy to connect to the API and check if the user and password match, but after that How can I keep using the auth function of laravel for logout, guest and auth pages, etc.

Other example that may work if it is easier to you understand it that way is imagine that I have my users on a text file instead on a database.

Please help me and thanks in advance.

You could use Auth::login($user); to simply do it after verifying credentials using API

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