Commit 0b68d616 authored by Shahzod's avatar Shahzod

Captcha

parent 38410e9b
......@@ -23,6 +23,7 @@
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hamcrest/hamcrest-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/intervention/image" />
<excludeFolder url="file://$MODULE_DIR$/vendor/jakub-onderka/php-console-color" />
<excludeFolder url="file://$MODULE_DIR$/vendor/jakub-onderka/php-console-highlighter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/jeremy-dunn/php-fedex-api-wrapper" />
......@@ -33,6 +34,7 @@
<excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/oauth1-client" />
<excludeFolder url="file://$MODULE_DIR$/vendor/maximebf/debugbar" />
<excludeFolder url="file://$MODULE_DIR$/vendor/mews/captcha" />
<excludeFolder url="file://$MODULE_DIR$/vendor/mockery/mockery" />
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
......
......@@ -99,6 +99,8 @@
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/intervention/image" />
<path value="$PROJECT_DIR$/vendor/mews/captcha" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" />
......
This diff is collapsed.
......@@ -36,4 +36,9 @@ class LoginController extends Controller
{
$this->middleware('guest')->except('logout');
}
public function refresh()
{
return captcha_img();
}
}
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "9f657ec865f9f65549dde33ed7da0d1f",
"content-hash": "31b801600acd96ae69916e04307a1296",
"packages": [
{
"name": "barryvdh/laravel-dompdf",
......@@ -687,6 +687,76 @@
],
"time": "2019-07-01T23:21:34+00:00"
},
{
"name": "intervention/image",
"version": "2.5.0",
"source": {
"type": "git",
"url": "https://github.com/Intervention/image.git",
"reference": "39eaef720d082ecc54c64bf54541c55f10db546d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Intervention/image/zipball/39eaef720d082ecc54c64bf54541c55f10db546d",
"reference": "39eaef720d082ecc54c64bf54541c55f10db546d",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"guzzlehttp/psr7": "~1.1",
"php": ">=5.4.0"
},
"require-dev": {
"mockery/mockery": "~0.9.2",
"phpunit/phpunit": "^4.8 || ^5.7"
},
"suggest": {
"ext-gd": "to use GD library based image processing.",
"ext-imagick": "to use Imagick based image processing.",
"intervention/imagecache": "Caching extension for the Intervention Image library"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
},
"laravel": {
"providers": [
"Intervention\\Image\\ImageServiceProvider"
],
"aliases": {
"Image": "Intervention\\Image\\Facades\\Image"
}
}
},
"autoload": {
"psr-4": {
"Intervention\\Image\\": "src/Intervention/Image"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Oliver Vogel",
"email": "oliver@olivervogel.com",
"homepage": "http://olivervogel.com/"
}
],
"description": "Image handling and manipulation library with support for Laravel integration",
"homepage": "http://image.intervention.io/",
"keywords": [
"gd",
"image",
"imagick",
"laravel",
"thumbnail",
"watermark"
],
"time": "2019-06-24T14:06:31+00:00"
},
{
"name": "jakub-onderka/php-console-color",
"version": "v0.2",
......@@ -1294,6 +1364,73 @@
],
"time": "2016-08-17T00:36:58+00:00"
},
{
"name": "mews/captcha",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/mewebstudio/captcha.git",
"reference": "2c9efa19d7d7ae56bed5f23e1c4c42ea5d01fc1a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mewebstudio/captcha/zipball/2c9efa19d7d7ae56bed5f23e1c4c42ea5d01fc1a",
"reference": "2c9efa19d7d7ae56bed5f23e1c4c42ea5d01fc1a",
"shasum": ""
},
"require": {
"ext-gd": "*",
"illuminate/config": "~5.0",
"illuminate/filesystem": "~5.0",
"illuminate/hashing": "~5.0",
"illuminate/support": "~5.0",
"intervention/image": "~2.2",
"php": ">=5.4"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.1"
},
"type": "package",
"extra": {
"laravel": {
"providers": [
"Mews\\Captcha\\CaptchaServiceProvider"
],
"aliases": {
"Captcha": "Mews\\Captcha\\Facades\\Captcha"
}
}
},
"autoload": {
"psr-4": {
"Mews\\Captcha\\": "src/"
},
"files": [
"src/helpers.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Muharrem ERİN",
"email": "me@mewebstudio.com",
"homepage": "https://github.com/mewebstudio",
"role": "Developer"
}
],
"description": "Laravel 5 Captcha Package",
"homepage": "https://github.com/mewebstudio/captcha",
"keywords": [
"captcha",
"laravel5 Captcha",
"laravel5 Security"
],
"time": "2019-08-16T21:57:24+00:00"
},
{
"name": "monolog/monolog",
"version": "1.25.1",
......
......@@ -176,6 +176,7 @@ return [
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Mews\Captcha\CaptchaServiceProvider::class,
],
......@@ -228,6 +229,7 @@ return [
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'PDF' => Barryvdh\DomPDF\Facade::class,
'Captcha' => Mews\Captcha\Facades\Captcha::class,
],
];
<?php
return [
'characters' => ['2', '3', '4', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'm', 'n', 'p', 'q', 'r', 't', 'u', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'M', 'N', 'P', 'Q', 'R', 'T', 'U', 'X', 'Y', 'Z'],
'default' => [
'length' => 9,
'width' => 120,
'height' => 36,
'quality' => 90,
'math' => true,
],
'math' => [
'length' => 9,
'width' => 120,
'height' => 36,
'quality' => 90,
'math' => true,
],
'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,
]
];
......@@ -34,6 +34,21 @@
</div>
<div class="form-wrap" >
<div class="captcha">
<span style="float: left;" >{!! captcha_img() !!} </span>
<button type="button" class="btn btn-success refresh" style=" float: right; margin-top: 2px; position: relative; border-radius: 8px; margin-bottom: 10px; ">Refresh</button>
</div>
<input id="captcha" type="text" class="form-input{{ $errors->has('captcha') ? ' has-error' : '' }}" name="captcha" placeholder="Введите код с картинки" required>
@if ($errors->has('captcha'))
<span class="invalid-feedback">
<strong>{{ $errors->first('captcha') }}</strong>
</span>
@endif
</div>
<div class="form-group row mb-0">
<div class="col-md-8 offset-md-4 mt-4">
......@@ -55,4 +70,7 @@
</div>
</div>
</section>
@endsection
......@@ -75,9 +75,20 @@
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript">
$(".refresh").click(function () {
$.ajax({
type: 'GET',
url: '{{url('/refresh')}}',
success: function (data) {
console.log(data);
$(".captcha span").html(data);
}
});
});
</script>
</body>
</html>
......@@ -158,4 +158,7 @@
@yield('custom_script')
</body>
</html>
......@@ -57,6 +57,9 @@ Route::get('/questions', function () {
});
Route::get('/refresh', 'Auth\LoginController@refresh')->name('refresh');
Route::post('/feedback/add', 'FeedbackController@addGuest');
//
//Route::get('/packages/pay', 'PackagesController@pay');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment