-
Notifications
You must be signed in to change notification settings - Fork 49
Captcha
JP Barbosa edited this page Mar 11, 2016
·
3 revisions
composer require greggilbert/recaptcha
nano config/app.php
...
'providers' => [
...
Greggilbert\Recaptcha\RecaptchaServiceProvider::class,
],
...
'aliases' => [
...
'Recaptcha' => Greggilbert\Recaptcha\Facades\Recaptcha::class,
],
php artisan vendor:publish
nano app/Http/Requests/RecommendationRequest.php
...
public function rules()
{
return [
'email' => 'required|email',
'g-recaptcha-response' => 'required|recaptcha'
];
}
...
nano resources/views/recommendations/create.blade.php
...
{!! Form::open(['route' => ['articles.recommendations.store', $article->id]]) !!}
<div class='form-group'>
{!! Form::label('email', 'Email:') !!}
{!! Form::text('email', null, ['class' => 'form-control']) !!}
</div>
{!! Recaptcha::render() !!}
{!! Form::submit('Send Recommendation', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
...
nano .env
...
RECAPTCHA_PUBLIC_KEY=YourCaptchaPublicKey
RECAPTCHA_PRIVATE_KEY=YourCaptchaPrivateKey
php artisan serve
redis-server
php artisan queue:listen
open http://localhost:8000/articles/1/recommendations/create
tail storage/logs/laravel.log
git add .
git commit -m "Add recaptcha"
Next step: Async External Content
- Setup
- Basic CRUD
- Validation
- Views
- Association
- Association Controller
- Association Views
- Basic Template
- Bootstrap
- Bootstrap CRUD
- Alerts
- Welcome Page
- Ajax CRUD
- Send Email
- Send Email Views
- Jobs Queue
- Captcha
- Async External Content
- Cached External Content
- Tests Setup
- Functional Tests
- Acceptance Tests
- Continuous Integration
- Deploy with Heroku
- Deploy with Forge
- Update README