public function generateSecret()
    {
        $secret = bin2hex(random_bytes(20));
        $this->secret = password_hash($secret, PASSWORD_DEFAULT);

        return $secret;
    }
public function generateSecret()
    {
        $secret = bin2hex(random_bytes(20));
        $this->secret = password_hash($secret, PASSWORD_DEFAULT);

        return $secret;
    }
public function generateSecret ( ) { $ secret = bin2hex ( random_bytes ( 20 ) ) ; $ this -> secret = password_hash ( $ secret , PASSWORD_DEFAULT ) ; return $ secret ; }
Creates a strong, unique secret and crypt it on the model

@return string Secret not encrypted
Creates a strong unique secret and crypt it on the model