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);
}
}`
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community