Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

lumen

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.

like image 895
JackSlayer94 Avatar asked Mar 08 '17 06:03

JackSlayer94


2 Answers

You could try:

app('hash')->make('yourpassword');
like image 169
Amr Aly Avatar answered Oct 19 '22 05:10

Amr Aly


another solution would be to use Facades\Hash

use Illuminate\Support\Facades\Hash;

code

'password' => Hash::make('your_password')
like image 36
Ernesto Aguaysol Avatar answered Oct 19 '22 05:10

Ernesto Aguaysol