diff --git a/app/Http/Controllers/Admin/EmployersController.php b/app/Http/Controllers/Admin/EmployersController.php
index 9ae013d..55ec9d1 100644
--- a/app/Http/Controllers/Admin/EmployersController.php
+++ b/app/Http/Controllers/Admin/EmployersController.php
@@ -31,7 +31,7 @@ class EmployersController extends Controller
->where('users.is_worker', '0')
->orderByDesc('emp.id')
->Realuser();
- $all_employer = $users->count();
+ $all_employer = Employer::all()->count();
$all_public = Employer::where('status_hidden', '=', '0')->
count();
@@ -83,6 +83,7 @@ class EmployersController extends Controller
// Форма обновления
public function form_update_employer(Employer $employer) {
// данные
+
$select_category = CategoryEmp::query()->active()->get();
$flots = Flot::query()->where('employer_id', '=', $employer->id)->get();
return view('admin.employer.edit', compact('employer', 'select_category', 'flots'));
@@ -172,6 +173,7 @@ class EmployersController extends Controller
//$user = User::find($employer->user_id);
$user_id = $employer->user_id;
+ $employer->name_company = $request->name;
$employer->telephone = $request->telephone;
$employer->email = $request->email;
$employer->address = $request->address;
@@ -192,9 +194,6 @@ class EmployersController extends Controller
}
$employer->save();
- $user = User::find($user_id);
- $user->update($params);
-
return redirect()->route('admin.employer-profile', ['employer' => $employer->id])
->with('success', 'Данные были успешно сохранены');
}
diff --git a/app/Http/Controllers/EducationController.php b/app/Http/Controllers/EducationController.php
index d1c35b2..8e92329 100644
--- a/app/Http/Controllers/EducationController.php
+++ b/app/Http/Controllers/EducationController.php
@@ -11,6 +11,7 @@ class EducationController extends Controller
// Образование
public function index(Request $request) {
$educations = Education::query()->active();
+
if (($request->has('search')) && (!empty($request->get('search')))) {
$search = trim($request->get('search'));
$educations = $educations->where('name', 'LIKE', "%$search%");
diff --git a/app/Http/Requests/FlotRequest.php b/app/Http/Requests/FlotRequest.php
index c9596f5..fa373ab 100644
--- a/app/Http/Requests/FlotRequest.php
+++ b/app/Http/Requests/FlotRequest.php
@@ -26,12 +26,15 @@ class FlotRequest extends FormRequest
return [
'name' => 'required|min:3|max:255',
'text' => 'required|min:5',
- //'image' => [
- // 'mimes:jpeg,jpg,png',
- // 'max:20000'
- //],
- 'region' => 'required|min:3|max:255',
- 'power' => 'required|min:3|max:255'
+ 'image' => [
+ 'mimes:jpeg,jpg,png',
+ 'max:20000'
+ ],
+ 'region' => 'nullable|min:3|max:255',
+ 'power' => 'nullable|min:3|max:255',
+ 'DWT' => 'nullable|max:255',
+ 'POWER_GD' => 'nullable|max:255',
+ 'IMO' => 'nullable|max:255',
];
}
diff --git a/resources/views/admin/employer/edit.blade.php b/resources/views/admin/employer/edit.blade.php
index 2d23456..d58caab 100644
--- a/resources/views/admin/employer/edit.blade.php
+++ b/resources/views/admin/employer/edit.blade.php
@@ -20,7 +20,7 @@
Имя компании
@error('name')
diff --git a/resources/views/admin/flot/test.blade.php b/resources/views/admin/flot/test.blade.php
index 889c7e1..4ef5de9 100644
--- a/resources/views/admin/flot/test.blade.php
+++ b/resources/views/admin/flot/test.blade.php
@@ -29,6 +29,66 @@
@enderror
+