Commit ab67900b by Bagus Pambudi

reload captcha

parent 50750dcf
...@@ -219,6 +219,6 @@ class LoginController extends Controller ...@@ -219,6 +219,6 @@ class LoginController extends Controller
} }
public function reloadCaptcha() public function reloadCaptcha()
{ {
return response()->json('captcha', captcha_img()); return response()->json(['captcha'=> captcha_img()]);
} }
} }
...@@ -95,16 +95,17 @@ ...@@ -95,16 +95,17 @@
@endsection @endsection
@push('scripts') @push('scripts')
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript"> <script>
$('.reload').click(function () { $(document).ready(function(){
console.log('tes'); $('#reload').click(function(){
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: 'reload-captcha', url: 'reload-captcha',
success: function (data) { success: function (data) {
$(".captcha span").html(data.captcha); $(".captcha span").html(data.captcha);
} }
}); });
}); })
})
</script> </script>
@endpush @endpush
\ No newline at end of file
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<!-- Styles --> <!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet"> <link href="{{ asset('css/app.css') }}" rel="stylesheet">
@stack('scripts')
</head> </head>
<body> <body>
<div id="app"> <div id="app">
...@@ -76,6 +77,6 @@ ...@@ -76,6 +77,6 @@
@yield('content') @yield('content')
</main> </main>
</div> </div>
@stack('scripts')
</body> </body>
</html> </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