alaindet's avatar

How to add NULL condition on Auth::attempt

I've overwritten AuthenticateUsers::credentials to add a condition, that works, but I'd like to check for a NULL value in a column on my users table, so I've tried this

protected function credentials(Request $request)
{
    return array_merge(
        $request->only($this->username(), 'password'),
        ['my-column' => null]
    );
}

But that bounces me back when attempting to login

0 likes
2 replies
pawelmysior's avatar

That should work, what do you mean it's "bouncing you back"?

1 like
alaindet's avatar

I meant that Auth::attemp returned FALSE. Anyway, I run

php artisan config:clear

And everything magically seems to work now, sorry for the unconvenience!

Please or to participate in this conversation.