Commit ab67900b by Bagus Pambudi

reload captcha

parent 50750dcf
......@@ -219,6 +219,6 @@ class LoginController extends Controller
}
public function reloadCaptcha()
{
return response()->json('captcha', captcha_img());
return response()->json(['captcha'=> captcha_img()]);
}
}
......@@ -95,16 +95,17 @@
@endsection
@push('scripts')
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
$('.reload').click(function () {
console.log('tes');
$.ajax({
type: 'GET',
url: 'reload-captcha',
success: function (data) {
$(".captcha span").html(data.captcha);
}
});
});
<script>
$(document).ready(function(){
$('#reload').click(function(){
$.ajax({
type: 'GET',
url: 'reload-captcha',
success: function (data) {
$(".captcha span").html(data.captcha);
}
});
})
})
</script>
@endpush
\ No newline at end of file
......@@ -18,6 +18,7 @@
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
@stack('scripts')
</head>
<body>
<div id="app">
......@@ -76,6 +77,6 @@
@yield('content')
</main>
</div>
@stack('scripts')
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment