biscolab/laravel-recaptcha

Data-Callback overwriting

koderis-volkovs opened this issue · 3 comments

Describe the bug
When I use invisible captcha, it's not possible to overwrite data-callback

{!! htmlFormButton(trans('contact.send_button'), ['class' => 'btn submit', 'data-badge' => 'bottomleft', 'data-callback' => 'myCustomFunction']) !!}

Screen Shot 2021-01-14 at 11 02 34

Expected behavior
data-callback attribute must be overwritten to myCustomFunction

Environment:

  • PHP version 7.4.11
  • Laravel version 8.19.0
  • Package version 5.0

Probably

$properties = array_merge($properties, [
    'data-sitekey'  => $this->api_site_key,
    'data-callback' => 'biscolabLaravelReCaptcha'
]);

should be changed to

$properties = array_merge($properties, [
    'data-sitekey'  => $this->api_site_key,
    'data-callback' => $properties['data-callback']' ?? biscolabLaravelReCaptcha',
]);

Hi @koderis-volkovs, thanks for your feedback. I've some doubts about your Laravel and PHP versions (Laravel's last release is currently 8.5.8...and it would require at least PHP 7.3). However, I'll check for this bug

ld require at least PHP 7.3). Howev

Sorry, fixed versions. What's possible ETA ?