Skip to content

Commit

Permalink
update captcha in view
Browse files Browse the repository at this point in the history
  • Loading branch information
linrium committed Dec 31, 2016
1 parent aef83e9 commit 0129e59
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use App\Http\Requests\LoginRequest;
use Auth;

Expand All @@ -29,6 +30,8 @@ class LoginController extends Controller
*/
protected $redirectTo = '/admin/year';

protected $maxLoginAttempts = 10;
protected $lockoutTime = 300;
/**
* Create a new controller instance.
*
Expand Down
7 changes: 5 additions & 2 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,17 @@ public function register(Request $request)
'txtPassword.min' => 'Password must least 6 character',
'txtRepassword.min' => 'Repassword must least 6 character',
'txtRepassword.required' => 'Please enter repassword',
'txtRepassword.same' => 'Repassword don\'t match'
'txtRepassword.same' => 'Repassword don\'t match',
'txtCaptcha.required' => 'Please enter captcha',
'txtCaptcha.captcha' => 'Captcha don\'t match',
];

$this->validate($request, [
'txtName' => 'required|max:255',
'txtEmail' => 'required|max:255|unique:users,email',
'txtPassword' => 'required|min:6',
'txtRepassword' => 'required|min:6|same:txtPassword'
'txtRepassword' => 'required|min:6|same:txtPassword',
'txtCaptcha' => 'required|captcha'
], $messages);

$user = new User();
Expand Down
45 changes: 45 additions & 0 deletions config/captcha.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

return [

'characters' => '2346789abcdefghjmnpqrtuxyzABCDEFGHJMNPQRTUXYZ',

'default' => [
'length' => 5,
'width' => 120,
'height' => 36,
'quality' => 90,
],

'flat' => [
'length' => 6,
'width' => 160,
'height' => 46,
'quality' => 90,
'lines' => 6,
'bgImage' => false,
'bgColor' => '#ecf2f4',
'fontColors'=> ['#2c3e50', '#c0392b', '#16a085', '#c0392b', '#8e44ad', '#303f9f', '#f57c00', '#795548'],
'contrast' => -5,
],

'mini' => [
'length' => 3,
'width' => 60,
'height' => 32,
],

'inverse' => [
'length' => 5,
'width' => 120,
'height' => 36,
'quality' => 90,
'sensitive' => true,
'angle' => 12,
'sharpen' => 10,
'blur' => 2,
'invert' => true,
'contrast' => -5,
]

];
4 changes: 4 additions & 0 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
<input type="password" class="form-control" id="txtRepassword" name="txtRepassword" placeholder="Please enter repassword">

</div>
<div class="form-group">
{!! captcha_img() !!}
<input type="text" class="form-control" id="txtCaptcha" name="txtCaptcha" placeholder="Please enter captcha">
</div>
<div class="form-group">
<div class="">
<button type="submit" class="btn btn-success">Sign up</button>
Expand Down

0 comments on commit 0129e59

Please sign in to comment.