laravel-captcha
laravel-captcha copied to clipboard
Blade template @captcha not showing image
Blade template directive @captcha not showing image after updating from v2.1 to v2.2.
@ThungdemoEzong got any solution? In my case the image is properly loading in localhost but not in my digital ocean server. @igoshev
https://github.com/igoshev/laravel-captcha/blob/49f798a3dec12305306ccd0c90f1d2f5ce4997ca/src/Captcha/Captcha.php#L107
changing
$route = route('bone.captcha.image', [], false)
to
$route = route('bone.captcha.image', [])
fixes the issue
The passing false as the third parameter generates a relative URL which causes the issue.
I had to clear the laravel view cache storage/framework/views
php artisan view:clear
I try all this solations but it still not showing image
For those using v2.2.*, I have found a workaround.
Publish the view files
php artisan vendor:publish --provider="Igoshev\Captcha\Providers\CaptchaServiceProvider" --tag="bone-captcha-views"
Open the file resources/views/vendor/bone/captcha/image.blade.php
Then replace everything with the following code
<img src="{{ route('bone.captcha.image') . '?' . mt_rand() }}"
alt="my-captcha"
style="cursor:pointer;width:auto;height:38px;"
title="{{ $title }}"
onclick="this.setAttribute('src','{{ route('bone.captcha.image') . '?' . mt_rand() }}&_='+Math.random());var captcha=document.getElementById('{{ $input_id }}');if(captcha){captcha.focus()}"
>
Have this issue as well
This is still not fixed. It works fine in my dev environment, but not on the AWS instance.
I am getting the same error