Commit a38568f2 authored by Shahzod's avatar Shahzod

Fucking Caotcha...

parent fde644ec
......@@ -3,12 +3,10 @@
<component name="ChangeListManager">
<list default="true" id="45142ad9-1f6f-4356-8738-3011f539d65e" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Auth/LoginController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Auth/LoginController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/FeedbackController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/FeedbackController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/HomeController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/HomeController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/composer.lock" beforeDir="false" afterPath="$PROJECT_DIR$/composer.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/captcha.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/captcha.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/main.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/main.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/pages/terms.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/pages/terms.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/contacts.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/contacts.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/routes/web.php" beforeDir="false" afterPath="$PROJECT_DIR$/routes/web.php" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
......@@ -39,6 +37,7 @@
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
<option name="UPDATE_TYPE" value="MERGE" />
</component>
<component name="PhpWorkspaceProjectConfiguration">
<include_path>
......@@ -239,7 +238,7 @@
<workItem from="1571336316933" duration="11634000" />
<workItem from="1571458855290" duration="49658000" />
<workItem from="1572018556391" duration="40349000" />
<workItem from="1573827723198" duration="5980000" />
<workItem from="1573827723198" duration="9495000" />
</task>
<task id="LOCAL-00001" summary="first commit (10/07/2019//11/;58)">
<created>1570475345391</created>
......@@ -472,7 +471,21 @@
<option name="project" value="LOCAL" />
<updated>1572210547463</updated>
</task>
<option name="localTasksCounter" value="34" />
<task id="LOCAL-00034" summary="CaptchaPer">
<created>1573833813364</created>
<option name="number" value="00034" />
<option name="presentableId" value="LOCAL-00034" />
<option name="project" value="LOCAL" />
<updated>1573833813364</updated>
</task>
<task id="LOCAL-00035" summary="CaptchaPer">
<created>1573835763654</created>
<option name="number" value="00035" />
<option name="presentableId" value="LOCAL-00035" />
<option name="project" value="LOCAL" />
<updated>1573835763654</updated>
</task>
<option name="localTasksCounter" value="36" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
......@@ -522,7 +535,8 @@
<MESSAGE value="fix bugs" />
<MESSAGE value="video" />
<MESSAGE value="Release 28.10.2019" />
<option name="LAST_COMMIT_MESSAGE" value="Release 28.10.2019" />
<MESSAGE value="CaptchaPer" />
<option name="LAST_COMMIT_MESSAGE" value="CaptchaPer" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
......
......@@ -21,6 +21,9 @@ class FeedbackController extends Controller
*/
public function addGuest(Request $request)
{
$request->validate([
'captcha' => 'required|captcha',
], ['captcha.captcha' => 'Неверный защитный код...']);
try {
$feedback = new Feedback();
$feedback->name = $request->input('name').' '.$request->input('last-name');
......@@ -36,4 +39,8 @@ class FeedbackController extends Controller
return redirect()->back()->with('flash_success', 'Сообщение отправлено успешно.');
}
}
\ No newline at end of file
public function addGuestCaptcha()
{
return captcha_img();
}
}
......@@ -5,7 +5,9 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
use Illuminate\Validation\Validator;
//use Illuminate\Validation\Validator;
use Validator;
//use Illuminate\Support\Facades\Validator;
class HomeController extends Controller
{
......@@ -48,11 +50,12 @@ class HomeController extends Controller
public function sendMail(Request $request)
{
// $request->validate([
// 'captcha' => 'require|captcha',
// ], ['captcha.captcha' => 'Неверный защитный код...']);
//
// dd($request->all());
//dd($request->all());
$request->validate([
'captcha' => 'required|captcha',
], ['captcha.captcha' => 'Неверный защитный код...']);
$name = $request->get('name');
$lastname = $request->get('lastname');
......
......@@ -5,7 +5,7 @@ return [
'default' => [
'length' => 6,
'width' => 150,
'height' => 56,
'height' => 70,
'quality' => 90,
'math' => false,
],
......
......@@ -9,9 +9,8 @@
<div class="col-xs-12 col-md-9 col-lg-6 col-md-offset-2 col-lg-offset-3">
<!--p.fw-l.h5.text-transform-none Enter your email address to receive all company news, special offers and other discount information.-->
<!-- RD Mailform-->
<form class="rd-mailform text-left" data-form-output="form-output-global"
data-form-type="forms" method="post"
action="{{ url('/feedback/add') }}">
<form method="post"
action="{{ route('send.mail') }}">
@csrf
<div class="row row-10">
<div class="col-xs-12 col-sm-6">
......@@ -48,8 +47,23 @@
<textarea class="form-input" id="forms-message" name="message"
data-constraints="@Required"></textarea>
</div>
</div>
<div class="col-xs-3 text-right" >
<div class="captcha">
<span style="float: left;" >{!! captcha_img() !!} </span>
</div>
</div>
<div class="col-xs-9 text-left" >
<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="col-xs-12 text-center">
<div class="col-xs-12 text-right">
<button class="btn btn-primary btn-sm" type="submit">Отправить</button>
</div>
</div>
......@@ -119,4 +133,4 @@
width="1980" height="460" frameborder="0" style="border:0" allowfullscreen></iframe>
</div>
</section>
@endsection
\ No newline at end of file
@endsection
......@@ -66,7 +66,9 @@ Route::get('/refresh', 'Auth\LoginController@refresh')->name('refresh');
//Route::post('/login', 'Auth\LoginController@refreshpost')->name('login');
Route::post('/feedback/add', 'FeedbackController@addGuest');
/*Route::get('/feedback/add', 'FeedbackController@addGuestCaptcha');
Route::post('/feedback/add', 'FeedbackController@addGuest');*/
Route::post('/send-mail', 'HomeController@sendMail')->name('send.mail');
Route::get('/send-mail', 'HomeController@sendMailGet');
//
......
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