Bcrypt not working in Lumen 5.4: Call to undefined function bcrypt()

JackSlayer94 picture JackSlayer94 · Mar 8, 2017 · Viewed 13.9k times · Source

I created a new Lumen 5.4 project and tried to seed some data. In the seeder, I used bcrypt to hash the password. But when I run php artisan db:seed, I get this error:

Call to undefined function bcrypt()

Why can't I use bcrypt in Lumen? I have used it in Laravel previously.

Answer

Amr Aly picture Amr Aly · Mar 8, 2017

You could try:

app('hash')->make('yourpassword');