diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 335c79b..8636ae0 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -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; @@ -29,6 +30,8 @@ class LoginController extends Controller */ protected $redirectTo = '/admin/year'; + protected $maxLoginAttempts = 10; + protected $lockoutTime = 300; /** * Create a new controller instance. * diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 8dd6ef6..d988492 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -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(); diff --git a/config/captcha.php b/config/captcha.php new file mode 100644 index 0000000..3627a25 --- /dev/null +++ b/config/captcha.php @@ -0,0 +1,45 @@ + '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, + ] + +]; diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 2cc53f2..1df0dea 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -50,6 +50,10 @@ +