Skip to content

Instantly share code, notes, and snippets.

@guiliredu
Created June 27, 2019 23:34
Show Gist options
  • Save guiliredu/ba5a911055b6b975152a43782e6f1b31 to your computer and use it in GitHub Desktop.
Save guiliredu/ba5a911055b6b975152a43782e6f1b31 to your computer and use it in GitHub Desktop.
Laravel recaptcha blade component
<div class="input-captcha">
<div class="g-recaptcha" data-sitekey="{{ config('app.recaptcha_key') }}"></div>
</div>
@push('scripts')
<script src='https://www.google.com/recaptcha/api.js'></script>
@endpush
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
@yield('content')
@stack('scripts')
</body>
</html>
@extends('app.blade.php')
@section('content')
@include('input-recaptcha')
@endsection
@guiliredu
Copy link
Author

You can include the captcha in your template and the script will be pushed to the scripts stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment