How to use the bcrypt function of laravel?

0

I have a .php file in the public folder of Laravel and for bigger reasons I can not create a controller of it. However I need to use the bcrypt function to generate the password an encrypted password, but I can not use this function in a .php pure file in the public folder.

How can I use this function?

    
asked by anonymous 09.09.2017 / 03:00

1 answer

2

To ensure that the bcrypt of the generated by laravel is exactly the same, make a controler to call an ajax, a kind of webservice, this controler will have the function to return

public function getBcrypt($secret) {

   return bcrypt('secret');

}

In your php file you can call this url via curl or ajax, it will generate the encrypted code perfectly.

    
10.09.2017 / 05:51