DEV Community

Benjamin Delespierre
Benjamin Delespierre

Posted on

4

Disable password checks on Laravel

Step 1 update your .env file

Add the following to .env

LOGIN_PASSWORD_CHECK=false
Enter fullscreen mode Exit fullscreen mode

Step 2 update your login controller

Change App/Http/Controllers/Auth/LoginController::attemptLogin to

protected function attemptLogin(Request $request)
{
    if (env('LOGIN_PASSWORD_CHECK', true) == false) {
        $this->guard()->login(
            User::whereEmail($request->input('email'))->firstOrFail()
        );
        return true;
    }

    return $this->guard()->attempt(
        $this->credentials($request),
        $request->filled('remember')
    );
}
Enter fullscreen mode Exit fullscreen mode

Step 3 done.

That's it. Now you can login with any password, it will accept it and log into the account designated by the email your provided in the login form.


Bonus if you're using Heroku, add this to your app.json to disable password check on review apps:

{
    "env": {
        "APP_ENV": "review",
        "LOGIN_PASSWORD_CHECK": "false"
    }
}
Enter fullscreen mode Exit fullscreen mode

Tell me what you thin in the comments and don't forget to leave a like!

Image of Stellar post

How a Hackathon Win Led to My Startup Getting Funded

In this episode, you'll see:

  • The hackathon wins that sparked the journey.
  • The moment José and Joseph decided to go all-in.
  • Building a working prototype on Stellar.
  • Using the PassKeys feature of Soroban.
  • Getting funded via the Stellar Community Fund.

Watch the video 🎥

Top comments (0)

Image of Stellar post

How a Hackathon Win Led to My Startup Getting Funded

In this episode, you'll see:

  • The hackathon wins that sparked the journey.
  • The moment José and Joseph decided to go all-in.
  • Building a working prototype on Stellar.
  • Using the PassKeys feature of Soroban.
  • Getting funded via the Stellar Community Fund.

Watch the video

👋 Kindness is contagious

Dive into this informative piece, backed by our vibrant DEV Community

Whether you’re a novice or a pro, your perspective enriches our collective insight.

A simple “thank you” can lift someone’s spirits—share your gratitude in the comments!

On DEV, the power of shared knowledge paves a smoother path and tightens our community ties. Found value here? A quick thanks to the author makes a big impact.

Okay