Created
February 10, 2019 11:06
-
-
Save uF4No/a9bd874396214ad545e2de10d30c8d43 to your computer and use it in GitHub Desktop.
Laravel blade contact form with reCaptcha
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="{{route('contact.send')}}" class="mb-3" method="post" enctype="multipart/form-data"> | |
{!! csrf_field() !!} | |
<div class="form-row"> | |
<div class="form-group col-md-5"> | |
<label for="name" class="control-label">Name</label> | |
<input name="name" class="form-control" type="text" id="name" value="{{old('name')}}"> | |
</div> | |
<div class="form-group col-md-7"> | |
<label for="email" class="control-label">Email</label> | |
<input name="email" class="form-control" type="email" id="email" value="{{old('email')}}"> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-12 form-group"> | |
<label for="body" class="control-label">Message</label> | |
<textarea name="body" id="body" class="form-control" cols="50" rows="10">{{old('body')}}</textarea> | |
</div> | |
</div> | |
@if(env('GOOGLE_RECAPTCHA_KEY')) | |
<div class="row"> | |
<div class="col-md-12 text-right"> | |
<div class="g-recaptcha" data-sitekey="{{env('GOOGLE_RECAPTCHA_KEY')}}"></div> | |
</div> | |
</div> | |
@endif | |
<div class="form-row mt-2"> | |
<div class="col-md-2 form-group text-right"> | |
<button type="submit" class="btn btn-info">Send</button> | |
</div> | |
</div> | |
</form> | |
<script src='https://www.google.com/recaptcha/api.js'></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment