Support the ongoing development of Laravel.io →
Authentication
Last updated 2 years ago.
0

Assuming you are on Laravel 5.X, you can specify the column you want to use as the username in your AuthController:

/**
 * The username of the user
 * @var [type]
 */
protected $username = 'username';
0

Thanks for your help, but I am using a middleware but not AuthController... I cannot use the protected $username field. What should I do?

This is my middleware:

`namespace App\Http\Middleware; use Auth; use Closure; class AuthenticateOnceWithBasicAuth {

public function handle($request, Closure $next)
{
    return Auth::onceBasic() ?: $next($request);
}

}`

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.