If you want to add Auth, you really need to introduce this class:
use Illuminate\Contracts\Auth\Guard;
This will solve everything that you defined inside:
config/auth.php
If you want to extend Auth, you can do this, but only for:
The protection driver, which is a protection class - it needs to implement the Guard or StatefulGuard interface.
The provider, which is the UserProvider class, needs to implement the UserProvider interface.
Standard Guard Guard drivers in Laravel / Lumen:
- Session session
- Tokenguard
Standard Auth UserProviders users are in Laravel / Lumen:
- EloquentUserProvider
- DatabaseUserProvider
You can read more about the Auth extension in the official Laravel documentation. See the link below:
https://laravel.com/docs/5.0/extending#authentication
This is the code I have in my controller and it works like a charm:
public function createToken(Request $request, Guard $guard) {
Best practice for extending the Auth class is the ServiceProvider () load method.
Hope this helps!
Greetings.
Glibo source share