adding feedback

This commit is contained in:
ROMANGOLIENKO 2024-04-24 15:27:07 +03:00
parent ba8d590a33
commit 197187091c
7 changed files with 135 additions and 26 deletions

View File

@ -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)

View File

@ -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',
];
}
}

View File

@ -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",

56
composer.lock generated
View File

@ -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",

View File

@ -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,

View File

@ -23,6 +23,8 @@
@yield('extra_styles')
<!-- css end here-->
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="csrf-param" content="_token"/>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">

View File

@ -74,11 +74,15 @@
integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous">
</script>
<body>
<header>
<div class="container-fluid position-relative fon1_blok visually_impaired_mode ">
<div class="mt-4 position-absolute" style="margin-left:11%;">@include('flash::message')</div>
<div class=" d-none d-xl-flex justify-content-end align-items-end position-absolute float-end z-1 "
style="height: 100%; ">
<div style="width: 60%">
@ -766,6 +770,8 @@
<div class="col-11">
<p class=" fs-4"> 385000, Республика Адыгея, г. Майкоп, ул. Первомайская, д. 191 </p>
</div>
<div class="col-11">
<a href="#"><img width="30px" height="30px" src="{{ URL::to('img/front-page/vid.png') }}" alt="vid"></a>
<a href="#"><img width="30px" height="30px" src="{{ URL::to('img/front-page/vk.png') }}" alt="vid"></a>
@ -781,6 +787,45 @@
</div>
</div>
</div>
<div class="row ms-4">
<!-- Button trigger modal -->
<div class="col-11">
<a class=" fs-4 btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#feedbackModal"> Обратная связь </a>
</div>
<!-- Modal -->
<div class="modal fade" id="feedbackModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form method="POST" action="{{route('feedback.store')}}">
@csrf
<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Ваши контакты</label>
<input type="text" class="form-control" name="contact" id="contact" aria-describedby="contactHelp" >
<div id="contactHelp" class="form-text"> Ваш телефон или электронная почта</div>
</div>
<div class="mb-3">
<label for="exampleInputPassword1" class="form-label"> Ваше сообщение</label>
<textarea type="text" class="form-control" name="text" id="text"> </textarea>
</div>
<button type="submit" class="btn btn-primary">Отправить</button>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Закрыть </button>
</div>
</div>
</div>
</div>
</div>
</div>
@ -792,4 +837,9 @@
</body>
<script>
$('div.alert').not('.alert-important').delay(15000).fadeOut(350);
</script>
@endsection