Support the ongoing development of →
Last updated 3 months ago.

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';

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 6 years ago.

Sign in to participate in this thread!


Your banner here too?


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

Your logo here?

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

© 2022 - All rights reserved.