From 197187091cf5df5a991c3a024bdc1435d851c09a Mon Sep 17 00:00:00 2001 From: ROMANGOLIENKO Date: Wed, 24 Apr 2024 15:27:07 +0300 Subject: [PATCH] adding feedback --- .../Controllers/admin/FeedbackController.php | 7 ++- .../Requests/admin/StoreFeedbackRequest.php | 1 - composer.json | 1 + composer.lock | 56 ++++++++++++++++++- database/seeders/DatabaseSeeder.php | 44 +++++++-------- .../views/layouts/new-design-layout.blade.php | 2 + .../new-design/bakalavr-special.blade.php | 50 +++++++++++++++++ 7 files changed, 135 insertions(+), 26 deletions(-) diff --git a/app/Http/Controllers/admin/FeedbackController.php b/app/Http/Controllers/admin/FeedbackController.php index f86a3cd..2a4b699 100644 --- a/app/Http/Controllers/admin/FeedbackController.php +++ b/app/Http/Controllers/admin/FeedbackController.php @@ -18,15 +18,18 @@ class FeedbackController extends Controller public function store(StoreFeedbackRequest $request) { + $validated = $request->validated(); $feedback = new Feedback(); $feedback->contact = $validated['contact']; $feedback->text = $validated['text']; - $feedback->status_id = $validated['status_id']; + $feedback->status_id = 1; $feedback->save(); - return response()->json(["result" => "success"]); + flash('Ваше сообщение отправлено!')->success(); + + return back(); } public function edit(Feedback $feedback) diff --git a/app/Http/Requests/admin/StoreFeedbackRequest.php b/app/Http/Requests/admin/StoreFeedbackRequest.php index 4a87b35..0d0331b 100644 --- a/app/Http/Requests/admin/StoreFeedbackRequest.php +++ b/app/Http/Requests/admin/StoreFeedbackRequest.php @@ -16,7 +16,6 @@ class StoreFeedbackRequest extends FormRequest return [ 'contact' => 'required|string|max:255', 'text' => 'string|nullable', - 'status_id' => 'required|numeric|exists:feedback_statuses,id', ]; } } diff --git a/composer.json b/composer.json index 444180c..22a4b04 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,7 @@ "fakerphp/faker": "^1.23.1", "guzzlehttp/guzzle": "^7.8.1", "imangazaliev/didom": "^2.0.1", + "laracasts/flash": "^3.2", "laravel/framework": "^10.48.2", "laravel/sanctum": "^3.3.3", "laravel/tinker": "^2.9.0", diff --git a/composer.lock b/composer.lock index 3253cc0..9a26d10 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7430aa832d42dad89f7314c9c96e0023", + "content-hash": "cdd9e5c44654ea2c37c37d36bc80e259", "packages": [ { "name": "brick/math", @@ -1302,6 +1302,60 @@ }, "time": "2023-03-05T03:23:48+00:00" }, + { + "name": "laracasts/flash", + "version": "3.2.3", + "source": { + "type": "git", + "url": "https://github.com/laracasts/flash.git", + "reference": "c2c4be1132f1bec3a689e84417a1c5787e6c71fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laracasts/flash/zipball/c2c4be1132f1bec3a689e84417a1c5787e6c71fd", + "reference": "c2c4be1132f1bec3a689e84417a1c5787e6c71fd", + "shasum": "" + }, + "require": { + "illuminate/support": "~5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "php": ">=5.4.0" + }, + "require-dev": { + "mockery/mockery": "dev-master", + "phpunit/phpunit": "^6.1|^9.5.10|^10.5" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laracasts\\Flash\\FlashServiceProvider" + ], + "aliases": { + "Flash": "Laracasts\\Flash\\Flash" + } + } + }, + "autoload": { + "files": [ + "src/Laracasts/Flash/functions.php" + ], + "psr-0": { + "Laracasts\\Flash": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jeffrey Way", + "email": "jeffrey@laracasts.com" + } + ], + "description": "Easy flash notifications", + "time": "2024-03-03T16:51:25+00:00" + }, { "name": "laravel/framework", "version": "v10.48.2", diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 53f700c..d798ee8 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -10,32 +10,32 @@ class DatabaseSeeder extends Seeder { public function run(): void { - User::factory()->create([ - 'name' => config('app.admin_name'), - 'email' => config('app.admin_email'), - 'password' => 123456 - ]); +// User::factory()->create([ +// 'name' => config('app.admin_name'), +// 'email' => config('app.admin_email'), +// 'password' => 123456 +// ]); // User::factory(10)->create(); - $this->call([ - EducationalInstitutionSeeder::class, - FacultySeeder::class, - DepartmentSeeder::class, - EducationLevelSeeder::class, - EducationFormSeeder::class, - ExaminationTypeSeeder::class, - SubjectSeeder::class, - SubjectTypeSeeder::class, - DirectionSeeder::class, - EntranceExaminationSeeder::class, - DirectionProfileSeeder::class, - ]); +// $this->call([ +// EducationalInstitutionSeeder::class, +// FacultySeeder::class, +// DepartmentSeeder::class, +// EducationLevelSeeder::class, +// EducationFormSeeder::class, +// ExaminationTypeSeeder::class, +// SubjectSeeder::class, +// SubjectTypeSeeder::class, +// DirectionSeeder::class, +// EntranceExaminationSeeder::class, +// DirectionProfileSeeder::class, +// ]); - $this->call([ - AdmissionSeeder::class, - DocumentSeeder::class, - ]); +// $this->call([ +// AdmissionSeeder::class, +// DocumentSeeder::class, +// ]); $this->call([ FeedbackStatusSeeder::class, diff --git a/resources/views/layouts/new-design-layout.blade.php b/resources/views/layouts/new-design-layout.blade.php index a6d52b9..46fc744 100644 --- a/resources/views/layouts/new-design-layout.blade.php +++ b/resources/views/layouts/new-design-layout.blade.php @@ -23,6 +23,8 @@ @yield('extra_styles') + + diff --git a/resources/views/new-design/bakalavr-special.blade.php b/resources/views/new-design/bakalavr-special.blade.php index 9eccae2..d81f63c 100644 --- a/resources/views/new-design/bakalavr-special.blade.php +++ b/resources/views/new-design/bakalavr-special.blade.php @@ -74,11 +74,15 @@ integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"> +
+ +
+
@include('flash::message')
@@ -766,6 +770,8 @@

385000, Республика Адыгея, г. Майкоп, ул. Первомайская, д. 191

+ +
vid vid @@ -781,6 +787,45 @@
+
+ + + + +
+
@@ -792,4 +837,9 @@ + + + @endsection