Commit 22f5df84fd3819d2cc3d8146ed7de9cc81daf551
1 parent
185d7799ae
Exists in
master
and in
1 other branch
Образование табы
Showing 4 changed files with 404 additions and 49 deletions Inline Diff
app/Http/Controllers/Admin/EducationController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers\Admin; | 3 | namespace App\Http\Controllers\Admin; |
4 | 4 | ||
5 | use App\Http\Controllers\Controller; | 5 | use App\Http\Controllers\Controller; |
6 | use App\Http\Requests\EducationRequest; | 6 | use App\Http\Requests\EducationRequest; |
7 | use App\Http\Requests\ProgramEducationRequest; | 7 | use App\Http\Requests\ProgramEducationRequest; |
8 | use App\Models\Education; | 8 | use App\Models\Education; |
9 | use App\Models\ProgramEducation; | 9 | use App\Models\ProgramEducation; |
10 | use Illuminate\Http\Request; | 10 | use Illuminate\Http\Request; |
11 | use Illuminate\Support\Facades\Storage; | 11 | use Illuminate\Support\Facades\Storage; |
12 | 12 | ||
13 | class EducationController extends Controller | 13 | class EducationController extends Controller |
14 | { | 14 | { |
15 | /** | 15 | /** |
16 | * Display a listing of the resource. | 16 | * Display a listing of the resource. |
17 | * | 17 | * |
18 | * @return \Illuminate\Http\Response | 18 | * @return \Illuminate\Http\Response |
19 | */ | 19 | */ |
20 | public function index() | 20 | public function index() |
21 | { | 21 | { |
22 | $education = Education::query()->active()->paginate(15); | 22 | $education = Education::query()->active()->paginate(15); |
23 | return view('admin.education.index', compact('education')); | 23 | return view('admin.education.index', compact('education')); |
24 | } | 24 | } |
25 | 25 | ||
26 | /** | 26 | /** |
27 | * Show the form for creating a new resource. | 27 | * Show the form for creating a new resource. |
28 | * | 28 | * |
29 | * @return \Illuminate\Http\Response | 29 | * @return \Illuminate\Http\Response |
30 | */ | 30 | */ |
31 | public function create() | 31 | public function create() |
32 | { | 32 | { |
33 | return view('admin.education.add'); | 33 | return view('admin.education.add'); |
34 | } | 34 | } |
35 | 35 | ||
36 | /** | 36 | /** |
37 | * Store a newly created resource in storage. | 37 | * Store a newly created resource in storage. |
38 | * | 38 | * |
39 | * @param \Illuminate\Http\Request $request | 39 | * @param \Illuminate\Http\Request $request |
40 | * @return \Illuminate\Http\Response | 40 | * @return \Illuminate\Http\Response |
41 | */ | 41 | */ |
42 | public function store(EducationRequest $request) | 42 | public function store(EducationRequest $request) |
43 | { | 43 | { |
44 | $params = $request->all(); | 44 | $params = $request->all(); |
45 | if ($request->has('image')) { | 45 | if ($request->has('image')) { |
46 | $params['image'] = $request->file('image')->store("education", 'public'); | 46 | $params['image'] = $request->file('image')->store("education", 'public'); |
47 | } | 47 | } |
48 | Education::create($params); | 48 | Education::create($params); |
49 | 49 | ||
50 | 50 | ||
51 | return redirect()->route('admin.education.index'); | 51 | return redirect()->route('admin.education.index'); |
52 | } | 52 | } |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * Display the specified resource. | 55 | * Display the specified resource. |
56 | * | 56 | * |
57 | * @param \App\Models\Education $education | 57 | * @param \App\Models\Education $education |
58 | * @return \Illuminate\Http\Response | 58 | * @return \Illuminate\Http\Response |
59 | */ | 59 | */ |
60 | public function show(Education $education) | 60 | public function show(Education $education) |
61 | { | 61 | { |
62 | // | 62 | // |
63 | } | 63 | } |
64 | 64 | ||
65 | /** | 65 | /** |
66 | * Show the form for editing the specified resource. | 66 | * Show the form for editing the specified resource. |
67 | * | 67 | * |
68 | * @param \App\Models\Education $education | 68 | * @param \App\Models\Education $education |
69 | * @return \Illuminate\Http\Response | 69 | * @return \Illuminate\Http\Response |
70 | */ | 70 | */ |
71 | public function edit(Education $education) | 71 | public function edit(Education $education) |
72 | { | 72 | { |
73 | $program = ProgramEducation::query()->where('education_id', '=', $education->id) | 73 | $program = ProgramEducation::query()->where('education_id', '=', $education->id) |
74 | ->orderBy('level')->get(); | 74 | ->orderBy('level')->get(); |
75 | return view('admin.education.edit', compact('education', 'program')); | 75 | return view('admin.education.edit', compact('education', 'program')); |
76 | } | 76 | } |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * Update the specified resource in storage. | 79 | * Update the specified resource in storage. |
80 | * | 80 | * |
81 | * @param \Illuminate\Http\Request $request | 81 | * @param \Illuminate\Http\Request $request |
82 | * @param \App\Models\Education $education | 82 | * @param \App\Models\Education $education |
83 | * @return \Illuminate\Http\Response | 83 | * @return \Illuminate\Http\Response |
84 | */ | 84 | */ |
85 | public function update(EducationRequest $request, Education $education) | 85 | public function update(EducationRequest $request, Education $education) |
86 | { | 86 | { |
87 | $params = $request->all(); | 87 | $params = $request->all(); |
88 | if ($request->has('image')) { | 88 | if ($request->has('image')) { |
89 | if (!empty($education->image)) { | 89 | if (!empty($education->image)) { |
90 | Storage::delete($education->image); | 90 | Storage::delete($education->image); |
91 | } | 91 | } |
92 | $params['image'] = $request->file('image')->store("education", 'public'); | 92 | $params['image'] = $request->file('image')->store("education", 'public'); |
93 | } | 93 | } |
94 | 94 | ||
95 | $education->update($params); | 95 | $education->update($params); |
96 | return redirect()->route('admin.education.index'); | 96 | return redirect()->route('admin.education.index'); |
97 | } | 97 | } |
98 | 98 | ||
99 | /** | 99 | /** |
100 | * Remove the specified resource from storage. | 100 | * Remove the specified resource from storage. |
101 | * | 101 | * |
102 | * @param \App\Models\Education $education | 102 | * @param \App\Models\Education $education |
103 | * @return \Illuminate\Http\Response | 103 | * @return \Illuminate\Http\Response |
104 | */ | 104 | */ |
105 | public function destroy(Education $education) | 105 | public function destroy(Education $education) |
106 | { | 106 | { |
107 | $education->update(['is_remove' => 1]); | 107 | $education->update(['is_remove' => 1]); |
108 | return redirect()->route('admin.education.index'); | 108 | return redirect()->route('admin.education.index'); |
109 | } | 109 | } |
110 | 110 | ||
111 | public function add_program(Request $request) { | 111 | public function add_program(Request $request) { |
112 | $id_education = $request->id; | 112 | $id_education = $request->id; |
113 | $level = $request->level; | 113 | $level = $request->level; |
114 | return view('admin.education.program', compact('id_education', 'level')); | 114 | return view('admin.education.program', compact('id_education', 'level')); |
115 | } | 115 | } |
116 | 116 | ||
117 | public function store_program(ProgramEducationRequest $request) { | 117 | public function store_program(ProgramEducationRequest $request) { |
118 | $education = $request->education_id; | 118 | $education = $request->education_id; |
119 | ProgramEducation::create($request->all()); | 119 | ProgramEducation::create($request->all()); |
120 | 120 | ||
121 | return redirect()->route('admin.education.edit', ['education' => $education]); | 121 | return redirect()->route('admin.education.edit', ['education' => $education]); |
122 | } | 122 | } |
123 | 123 | ||
124 | public function edit_program(ProgramEducation $program, Education $education) { | ||
125 | $id_education = $education->id; | ||
126 | return view('admin.education.program-edit', compact('id_education', 'education', 'program')); | ||
127 | } | ||
128 | |||
129 | public function update_program(ProgramEducationRequest $request, ProgramEducation $program, Education $education) { | ||
130 | $program->update($request->all()); | ||
131 | return redirect()->route('admin.education.edit', ['education' => $education]); | ||
132 | } | ||
133 | |||
124 | public function delete_program(ProgramEducation $program, Education $education) { | 134 | public function delete_program(ProgramEducation $program, Education $education) { |
125 | $education = $education->id; | 135 | $education = $education->id; |
126 | $program->delete(); | 136 | $program->delete(); |
127 | 137 | ||
128 | return redirect()->route('admin.education.edit', ['education' => $education]); | 138 | return redirect()->route('admin.education.edit', ['education' => $education]); |
129 | } | 139 | } |
130 | 140 | ||
131 | } | 141 | } |
132 | 142 |
resources/views/admin/education/form.blade.php
1 | @csrf | 1 | @csrf |
2 | 2 | ||
3 | @isset($education) | 3 | @isset($education) |
4 | @method('PUT') | 4 | @method('PUT') |
5 | @endisset | 5 | @endisset |
6 | 6 | ||
7 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | 7 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> |
8 | <form method="POST" action="{{ route('admin.education.update', ['education' => $education->id]) }}" enctype="multipart/form-data"> | 8 | <form method="POST" action="{{ route('admin.education.update', ['education' => $education->id]) }}" enctype="multipart/form-data"> |
9 | <label class="block text-sm"> | 9 | <label class="block text-sm"> |
10 | <span class="text-gray-700 dark:text-gray-400">Название учебного заведения</span> | 10 | <span class="text-gray-700 dark:text-gray-400">Название учебного заведения</span> |
11 | <input name="name" id="name" | 11 | <input name="name" id="name" |
12 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 12 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" |
13 | placeholder="Название учебного заведения" value="{{ old('name') ?? $education->name ?? '' }}" | 13 | placeholder="Название учебного заведения" value="{{ old('name') ?? $education->name ?? '' }}" |
14 | /> | 14 | /> |
15 | @error('name') | 15 | @error('name') |
16 | <span class="text-xs text-red-600 dark:text-red-400"> | 16 | <span class="text-xs text-red-600 dark:text-red-400"> |
17 | {{ $message }} | 17 | {{ $message }} |
18 | </span> | 18 | </span> |
19 | @enderror | 19 | @enderror |
20 | </label><br> | 20 | </label><br> |
21 | 21 | ||
22 | <label class="block text-sm"> | 22 | <label class="block text-sm"> |
23 | <span class="text-gray-700 dark:text-gray-400">Текст</span> | 23 | <span class="text-gray-700 dark:text-gray-400">Текст</span> |
24 | <textarea class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray ckeditor_" name="text" placeholder="Текст (html)" required | 24 | <textarea class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray ckeditor_" name="text" placeholder="Текст (html)" required |
25 | rows="10">{{ old('text') ?? $education->text ?? '' }}</textarea> | 25 | rows="10">{{ old('text') ?? $education->text ?? '' }}</textarea> |
26 | @error('text') | 26 | @error('text') |
27 | <span class="text-xs text-red-600 dark:text-red-400"> | 27 | <span class="text-xs text-red-600 dark:text-red-400"> |
28 | {{ $message }} | 28 | {{ $message }} |
29 | </span> | 29 | </span> |
30 | @enderror | 30 | @enderror |
31 | </label><br> | 31 | </label><br> |
32 | 32 | ||
33 | <label class="block text-sm"> | 33 | <label class="block text-sm"> |
34 | <span class="text-gray-700 dark:text-gray-400">Картинка</span> | 34 | <span class="text-gray-700 dark:text-gray-400">Картинка</span> |
35 | <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 | 35 | <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 |
36 | focus:border-purple-400 focus:outline-none focus:shadow-outline-purple | 36 | focus:border-purple-400 focus:outline-none focus:shadow-outline-purple |
37 | dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 37 | dark:text-gray-300 dark:focus:shadow-outline-gray form-input" |
38 | id="image" name="image" accept="image/png, image/jpeg"> | 38 | id="image" name="image" accept="image/png, image/jpeg"> |
39 | @error('image') | 39 | @error('image') |
40 | <span class="text-xs text-red-600 dark:text-red-400"> | 40 | <span class="text-xs text-red-600 dark:text-red-400"> |
41 | {{ $message }} | 41 | {{ $message }} |
42 | </span> | 42 | </span> |
43 | @enderror | 43 | @enderror |
44 | @isset($education->image) | 44 | @isset($education->image) |
45 | <img src="{{asset(Storage::url($education->image))}}" width="100px"/> | 45 | <img src="{{asset(Storage::url($education->image))}}" width="100px"/> |
46 | @endisset | 46 | @endisset |
47 | </label><br> | 47 | </label><br> |
48 | 48 | ||
49 | <hr> | 49 | <hr> |
50 | <h5 class="text-gray-700 dark:text-gray-400">Контакты: </h5> | 50 | <h5 class="text-gray-700 dark:text-gray-400">Контакты: </h5> |
51 | <label class="block text-sm"> | 51 | <label class="block text-sm"> |
52 | <span class="text-gray-700 dark:text-gray-400">Адрес</span> | 52 | <span class="text-gray-700 dark:text-gray-400">Адрес</span> |
53 | <input name="address" id="address" | 53 | <input name="address" id="address" |
54 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 54 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" |
55 | placeholder="Адрес" value="{{ old('address') ?? $education->address ?? '' }}" | 55 | placeholder="Адрес" value="{{ old('address') ?? $education->address ?? '' }}" |
56 | /> | 56 | /> |
57 | @error('address') | 57 | @error('address') |
58 | <span class="text-xs text-red-600 dark:text-red-400"> | 58 | <span class="text-xs text-red-600 dark:text-red-400"> |
59 | {{ $message }} | 59 | {{ $message }} |
60 | </span> | 60 | </span> |
61 | @enderror | 61 | @enderror |
62 | </label><br> | 62 | </label><br> |
63 | 63 | ||
64 | <label class="block text-sm"> | 64 | <label class="block text-sm"> |
65 | <span class="text-gray-700 dark:text-gray-400">Email</span> | 65 | <span class="text-gray-700 dark:text-gray-400">Email</span> |
66 | <input name="email" id="email" | 66 | <input name="email" id="email" |
67 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 67 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" |
68 | placeholder="Email" value="{{ old('email') ?? $education->email ?? '' }}" | 68 | placeholder="Email" value="{{ old('email') ?? $education->email ?? '' }}" |
69 | /> | 69 | /> |
70 | @error('email') | 70 | @error('email') |
71 | <span class="text-xs text-red-600 dark:text-red-400"> | 71 | <span class="text-xs text-red-600 dark:text-red-400"> |
72 | {{ $message }} | 72 | {{ $message }} |
73 | </span> | 73 | </span> |
74 | @enderror | 74 | @enderror |
75 | </label><br> | 75 | </label><br> |
76 | 76 | ||
77 | <label class="block text-sm"> | 77 | <label class="block text-sm"> |
78 | <span class="text-gray-700 dark:text-gray-400">Телефон</span> | 78 | <span class="text-gray-700 dark:text-gray-400">Телефон</span> |
79 | <input name="telephone" id="telephone" | 79 | <input name="telephone" id="telephone" |
80 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 80 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" |
81 | placeholder="Телефон" value="{{ old('telephone') ?? $education->telephone ?? '' }}" | 81 | placeholder="Телефон" value="{{ old('telephone') ?? $education->telephone ?? '' }}" |
82 | /> | 82 | /> |
83 | @error('telephone') | 83 | @error('telephone') |
84 | <span class="text-xs text-red-600 dark:text-red-400"> | 84 | <span class="text-xs text-red-600 dark:text-red-400"> |
85 | {{ $message }} | 85 | {{ $message }} |
86 | </span> | 86 | </span> |
87 | @enderror | 87 | @enderror |
88 | </label><br> | 88 | </label><br> |
89 | 89 | ||
90 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | 90 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> |
91 | <div> | 91 | <div> |
92 | <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> | 92 | <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> |
93 | Сохранить | 93 | Сохранить |
94 | </button> | 94 | </button> |
95 | <a href="{{ route('admin.education.index') }}" | 95 | <a href="{{ route('admin.education.index') }}" |
96 | class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | 96 | class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" |
97 | style="display: -webkit-inline-box; height: 30px!important;" | 97 | style="display: -webkit-inline-box; height: 30px!important;" |
98 | >Назад</a> | 98 | >Назад</a> |
99 | </div> | 99 | </div> |
100 | </div> | 100 | </div> |
101 | </form> | 101 | </form> |
102 | 102 | ||
103 | @isset($education) | 103 | @isset($education) |
104 | <hr> | 104 | <div class="tabs_ js_tabs px-4 py-3 bg-white rounded-lg shadow-md dark:bg-gray-800"> |
105 | <h5 class="text-gray-700 dark:text-gray-400">Специалитеты и категории:</h5> | 105 | <h2 class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200"> |
106 | <form method="GET" action="{{ route('admin.add-program-education') }}"> | 106 | Программы образования |
107 | <label class="block text-sm"> | 107 | </h2> |
108 | <span class="text-gray-700 dark:text-gray-400">Категория образования</span> | 108 | <form class="tabs__form js_tabs_form" method="GET" action="{{ route('admin.add-program-education') }}"> |
109 | <input type="hidden" name="id" value="{{ $education->id }}"/> | 109 | <label class="tabs__label block mt-4 text-sm"> |
110 | <input name="level" id="level" | 110 | <div class="relative text-gray-500 focus-within:text-purple-600"> |
111 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 111 | <input type="hidden" name="id" value="{{ $education->id }}"/> |
112 | placeholder="Новое образование" value="" | 112 | <input name="level" class="tabs__input js_tabs_input block w-full pr-20 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" placeholder="Введите название таба"/> |
113 | /><br> | 113 | <!-- For disabled buttons ADD these classes: opacity-50 cursor-not-allowed |
114 | <button type="submit" id="btn_education" name="btn_education" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> | 114 | And REMOVE these classes: active:bg-purple-600 hover:bg-purple-700 focus:shadow-outline-purple --> |
115 | Добавить | 115 | <button class="tabs__submit-btn js_tabs_submit_btn absolute inset-y-0 right-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-r-md focus:outline-none opacity-50 cursor-not-allowed" disabled>+</button> |
116 | </button> | 116 | <!-- <button class="tabs__submit-btn js_tabs_submit_btn absolute inset-y-0 right-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-r-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">+</button> --> |
117 | </label><br> | ||
118 | </form> | ||
119 | <hr> | ||
120 | @if ($program->count()) | ||
121 | @php $bool = true; | ||
122 | $i = 1; | ||
123 | $level = ""; | ||
124 | @endphp | ||
125 | |||
126 | @foreach ($program as $pro) | ||
127 | @if ((!empty($level)) && ($level <> $pro->level )) | ||
128 | </div> | ||
129 | </div><br> | ||
130 | @php $bool = true; $i++; @endphp | ||
131 | @endif | ||
132 | @if ($bool == true) | ||
133 | <div class="tabs"> | ||
134 | <input type="radio" name="tab-btn" id="tab-btn-{{$i}}" value="" checked> | ||
135 | <label for="tab-btn-{{$i}}">{{ $pro->level }}</label> | ||
136 | <div id="content-{{$i}}"> | ||
137 | |||
138 | @php $bool = false; | ||
139 | $level = $pro->level; | ||
140 | @endphp | ||
141 | @endif | ||
142 | <label class="block text-sm"> | ||
143 | <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300">Специальность: {{$pro->name}}</h4> | ||
144 | <span class="text-gray-700 dark:text-gray-400">Описание: {{$pro->text}}</span> | ||
145 | <a href="{{ route('admin.delete-program-education', ['program' => $pro->id, 'education' => $education->id]) }}">Удалить</a> | ||
146 | </label><br><hr> | ||
147 | @endforeach | ||
148 | </div> | 117 | </div> |
149 | </div><br> | 118 | </label> |
150 | @else | 119 | </form> |
151 | <span class="text-gray-700 dark:text-gray-400">Нет записей</span> | 120 | <div class="tabs__buttons js_tabs_buttons flex flex-col flex-wrap mb-4 md:flex-row md:space-x-4"> |
152 | @endif | 121 | @if ($program->count()) |
153 | @endisset | 122 | @php $bool = true; |
123 | $i = 1; | ||
124 | $level = ""; | ||
125 | @endphp | ||
126 | |||
127 | @foreach ($program as $pro) | ||
128 | @if ((!empty($level)) && ($level <> $pro->level )) | ||
129 | @php $bool = true; $i++; @endphp | ||
130 | @endif | ||
131 | @if ($bool == true) | ||
132 | <div> | ||
133 | <button class="tabs__btn js_tabs_btn mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" data-btn="{{ $pro->level }}" data-id="{{$i}}">{{ $pro->level }}</button> | ||
134 | </div> | ||
135 | @php $bool = false; | ||
136 | $level = $pro->level; | ||
137 | @endphp | ||
138 | @endif | ||
139 | @endforeach | ||
140 | @endif | ||
141 | </div> | ||
142 | <div class="tabs__content js_tabs_content"> | ||
143 | @if ($program->count()) | ||
144 | @php $bool = true; | ||
145 | $i = 1; | ||
146 | $level = ""; | ||
147 | @endphp | ||
148 | |||
149 | @foreach ($program as $pro) | ||
150 | @if ((!empty($level)) && ($level <> $pro->level)) | ||
151 | </tbody> | ||
152 | </table> | ||
153 | </div> | ||
154 | @php $bool = true; $i++; @endphp | ||
155 | @endif | ||
156 | |||
157 | @if ($bool == true) | ||
158 | <div class="tabs__item js_tabs_item @php echo($i>1) ? 'hidden' : ''; @endphp" data-id="{{$i}}"> | ||
159 | <table class="mb-4 w-full whitespace-no-wrap"> | ||
160 | <thead> | ||
161 | <tr | ||
162 | class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" | ||
163 | > | ||
164 | <th class="px-4 py-3">Специализация</th> | ||
165 | <th class="px-4 py-3">Описание</th> | ||
166 | <th class="px-4 py-3">Редактирование</th> | ||
154 | 167 | ||
168 | </tr> | ||
169 | </thead> | ||
170 | <tbody | ||
171 | class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800" | ||
172 | > | ||
173 | @php $bool = false; | ||
174 | $level = $pro->level; | ||
175 | @endphp | ||
176 | @endif | ||
177 | <tr class="text-gray-700 dark:text-gray-400"> | ||
178 | <td class="px-4 py-3"> | ||
179 | <div class="flex items-center text-sm"> | ||
180 | <div> | ||
181 | <p class="font-semibold">Специальность: </p> | ||
182 | <p class="text-xs text-gray-600 dark:text-gray-400"> | ||
183 | {{$pro->name}} | ||
184 | </p> | ||
185 | </div> | ||
186 | </div> | ||
187 | </td> | ||
188 | <td class="px-4 py-3 text-sm"> | ||
189 | <span class="text-gray-700 dark:text-gray-400">Описание: {{$pro->text}}</span> | ||
190 | </td> | ||
191 | <td class="px-4 py-3 text-xs"> | ||
192 | <a href="{{ route('admin.edit-program-education', ['program' => $pro->id, 'education' => $education->id]) }}">Изменить</a> | | ||
193 | <a href="{{ route('admin.delete-program-education', ['program' => $pro->id, 'education' => $education->id]) }}">Удалить</a> | ||
194 | |||
195 | </td> | ||
196 | </tr> | ||
197 | @endforeach | ||
198 | @endif | ||
199 | </div> | ||
200 | </div> | ||
201 | @endisset | ||
155 | </div> | 202 | </div> |
203 | |||
156 | <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> | 204 | <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> |
157 | 205 | ||
158 | <!--<script src="{{ asset('./ckeditor/ckeditor.js') }}"></script>--> | 206 | <!--<script src="{{ asset('./ckeditor/ckeditor.js') }}"></script>--> |
159 | <script> | 207 | <script> |
160 | CKEDITOR.replace( 'text', { | 208 | CKEDITOR.replace( 'text', { |
161 | filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", | 209 | filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", |
162 | filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", | 210 | filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", |
163 | filebrowserUploadMethod: 'form' | 211 | filebrowserUploadMethod: 'form' |
164 | }); | 212 | }); |
165 | </script> | 213 | </script> |
214 | <script> | ||
215 | window.addEventListener('DOMContentLoaded', () => { | ||
216 | |||
217 | setTabs(3); | ||
218 | |||
219 | function setTabs(qty) { | ||
220 | |||
221 | const tabs = document.querySelector('.js_tabs'); | ||
222 | const tabsForm = tabs.querySelector('.js_tabs_form'); | ||
223 | const tabsInput = tabs.querySelector('.js_tabs_input'); | ||
224 | const tabsSubmitBtn = tabs.querySelector('.js_tabs_submit_btn'); | ||
225 | const tabsButtons = tabs.querySelector('.js_tabs_buttons'); | ||
226 | const tabsContent = tabs.querySelector('.js_tabs_content'); | ||
227 | |||
228 | tabsForm.addEventListener('submit', (e) => { | ||
229 | |||
230 | //e.preventDefault(); | ||
231 | |||
232 | const tabsInputValue = tabsInput.value; | ||
233 | const tabsBtns = tabsButtons.querySelectorAll('.js_tabs_btn'); | ||
234 | const id = Date.now(); | ||
235 | |||
236 | if (tabsInput.dataset.edit) { | ||
237 | |||
238 | tabsBtns.forEach(btn => { | ||
239 | if (tabsInput.dataset.edit === btn.dataset.id) { | ||
240 | btn.textContent = tabsInputValue; | ||
241 | btn.dataset.btn = tabsInputValue; | ||
242 | } | ||
243 | }); | ||
244 | console.log('Эта ветка выполнилась'); | ||
245 | tabsInput.removeAttribute('data-edit'); | ||
246 | |||
247 | } else { | ||
248 | |||
249 | if (!tabsBtns.length) { | ||
250 | tabsButtons.innerHTML += getTabsBtnTemplate(tabsInputValue, id); | ||
251 | tabsContent.innerHTML += getTabsItemTemplate(id); | ||
252 | } | ||
253 | |||
254 | if (tabsBtns.length && tabsBtns.length < qty) { | ||
255 | |||
256 | let isMatch = false; | ||
257 | |||
258 | tabsBtns.forEach(btn => { | ||
259 | if (tabsInputValue === btn.dataset.btn) { | ||
260 | isMatch = true; | ||
261 | } | ||
262 | }); | ||
263 | |||
264 | console.log('Альтернативная ветка!'); | ||
265 | if (!isMatch) { | ||
266 | tabsButtons.innerHTML += getTabsBtnTemplate(tabsInputValue, id); | ||
267 | tabsContent.innerHTML += getTabsItemTemplate(id, 'hidden'); | ||
268 | } | ||
269 | } | ||
270 | } | ||
271 | |||
272 | tabsInput.value = ''; | ||
273 | addDisabledBtnStatus(tabsSubmitBtn); | ||
274 | |||
275 | }); | ||
276 | |||
277 | tabsInput.addEventListener('input', () => { | ||
278 | |||
279 | if (tabsInput.value !== '') { | ||
280 | removeDisabledBtnStatus(tabsSubmitBtn); | ||
281 | } else { | ||
282 | addDisabledBtnStatus(tabsSubmitBtn); | ||
283 | } | ||
284 | |||
285 | }); | ||
286 | |||
287 | tabsButtons.addEventListener('click', (e) => { | ||
288 | |||
289 | const target = e.target.closest('.js_tabs_btn'); | ||
290 | |||
291 | if (target) { | ||
292 | |||
293 | const tabsItems = tabs.querySelectorAll('.js_tabs_item'); | ||
294 | |||
295 | tabsItems.forEach(item => { | ||
296 | |||
297 | item.classList.add('hidden'); | ||
298 | |||
299 | if (target.dataset.id === item.dataset.id) { | ||
300 | item.classList.remove('hidden'); | ||
301 | } | ||
302 | }); | ||
303 | } | ||
304 | |||
305 | }); | ||
306 | |||
307 | tabsButtons.addEventListener('dblclick', (e) => { | ||
308 | |||
309 | const target = e.target.closest('.js_tabs_btn'); | ||
310 | |||
311 | if (target) { | ||
312 | |||
313 | tabsInput.value = target.dataset.btn; | ||
314 | tabsInput.dataset.edit = target.dataset.id; | ||
315 | removeDisabledBtnStatus(tabsSubmitBtn); | ||
316 | |||
317 | } | ||
318 | |||
319 | }); | ||
320 | |||
321 | function getTabsBtnTemplate(btnName, id) { | ||
322 | return ` | ||
323 | <div> | ||
324 | <button class="tabs__btn js_tabs_btn mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" data-btn="${btnName}" data-id="${id}">${btnName}</button> | ||
325 | </div> | ||
326 | `; | ||
327 | } | ||
328 | |||
329 | function getTabsItemTemplate(id, className = '') { | ||
330 | return ` | ||
331 | <div class="tabs__item js_tabs_item ${className}" data-id="${id}"> | ||
332 | <div class="mb-4">${id}</div> | ||
333 | <table class="mb-4 w-full whitespace-no-wrap"> | ||
334 | <thead> | ||
335 | <tr | ||
336 | class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" | ||
337 | > | ||
338 | <th class="px-4 py-3">Client</th> | ||
339 | <th class="px-4 py-3">Amount</th> | ||
340 | <th class="px-4 py-3">Status</th> | ||
341 | <th class="px-4 py-3">Date</th> | ||
342 | </tr> | ||
343 | </thead> | ||
344 | <tbody | ||
345 | class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800" | ||
346 | > | ||
347 | <tr class="text-gray-700 dark:text-gray-400"> | ||
348 | <td class="px-4 py-3"> | ||
349 | <div class="flex items-center text-sm"> | ||
350 | <!-- Avatar with inset shadow --> | ||
351 | <div | ||
352 | class="relative hidden w-8 h-8 mr-3 rounded-full md:block" | ||
353 | > | ||
354 | <img | ||
355 | class="object-cover w-full h-full rounded-full" | ||
356 | src="https://images.unsplash.com/flagged/photo-1570612861542-284f4c12e75f?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&ixid=eyJhcHBfaWQiOjE3Nzg0fQ" | ||
357 | alt="" | ||
358 | loading="lazy" | ||
359 | /> | ||
360 | <div | ||
361 | class="absolute inset-0 rounded-full shadow-inner" | ||
362 | aria-hidden="true" | ||
363 | ></div> | ||
364 | </div> | ||
365 | <div> | ||
366 | <p class="font-semibold">Hans Burger</p> | ||
367 | <p class="text-xs text-gray-600 dark:text-gray-400"> | ||
368 | 10x Developer | ||
369 | </p> | ||
370 | </div> | ||
371 | </div> | ||
372 | </td> | ||
373 | <td class="px-4 py-3 text-sm"> | ||
374 | $ 863.45 | ||
375 | </td> | ||
376 | <td class="px-4 py-3 text-xs"> | ||
377 | <span | ||
378 | class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100" | ||
379 | > | ||
380 | Approved | ||
381 | </span> | ||
382 | </td> | ||
383 | <td class="px-4 py-3 text-sm"> | ||
384 | 6/10/2020 | ||
385 | </td> | ||
386 | </tr> | ||
387 | |||
388 | <tr class="text-gray-700 dark:text-gray-400"> | ||
389 | <td class="px-4 py-3"> | ||
390 | <div class="flex items-center text-sm"> | ||
391 | <!-- Avatar with inset shadow --> | ||
392 | <div | ||
393 | class="relative hidden w-8 h-8 mr-3 rounded-full md:block" | ||
394 | > | ||
395 | <img | ||
396 | class="object-cover w-full h-full rounded-full" | ||
397 | src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&facepad=3&fit=facearea&s=707b9c33066bf8808c934c8ab394dff6" | ||
398 | alt="" | ||
399 | loading="lazy" | ||
400 | /> | ||
401 | <div | ||
402 | class="absolute inset-0 rounded-full shadow-inner" | ||
403 | aria-hidden="true" | ||
404 | ></div> | ||
405 | </div> | ||
406 | <div> | ||
407 | <p class="font-semibold">Jolina Angelie</p> | ||
408 | <p class="text-xs text-gray-600 dark:text-gray-400"> | ||
409 | Unemployed | ||
410 | </p> | ||
411 | </div> | ||
412 | </div> | ||
413 | </td> | ||
414 | <td class="px-4 py-3 text-sm"> | ||
415 | $ 369.95 | ||
416 | </td> | ||
417 | <td class="px-4 py-3 text-xs"> | ||
418 | <span | ||
419 | class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600" | ||
420 | > | ||
421 | Pending | ||
422 | </span> | ||
423 | </td> | ||
424 | <td class="px-4 py-3 text-sm"> | ||
425 | 6/10/2020 | ||
426 | </td> | ||
427 | </tr> | ||
428 | </tbody> | ||
429 | </table> | ||
430 | |||
431 | <div class="flex flex-col flex-wrap mb-4 md:flex-row md:space-x-4"> |
resources/views/admin/education/program-edit.blade.php
File was created | 1 | @extends('layout.admin', ['title' => 'Админка - Образование - Редактирование программы обучения']) | |
2 | |||
3 | @section('content') | ||
4 | <form method="POST" action="{{ route('admin.update-program-education', ['program' => $program, 'education' => $education]) }}"> | ||
5 | @csrf | ||
6 | |||
7 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | ||
8 | <input type="hidden" id="education_id" name="education_id" value="{{ $id_education }}"/> | ||
9 | <input type="hidden" id="level" name="level" value="{{ $program->name }}"/> | ||
10 | |||
11 | <label class="block text-sm"> | ||
12 | <span class="text-gray-700 dark:text-gray-400">Название специализации</span> | ||
13 | <input name="name" id="name" | ||
14 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | ||
15 | placeholder="Название специализации" required value="{{ old('name') ?? $program->name ?? '' }}" | ||
16 | /> | ||
17 | @error('name') | ||
18 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
19 | {{ $message }} | ||
20 | </span> | ||
21 | @enderror | ||
22 | </label><br> | ||
23 | |||
24 | <label class="block text-sm"> | ||
25 | <span class="text-gray-700 dark:text-gray-400">Текст</span> | ||
26 | <textarea class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray ckeditor" name="text" placeholder="Текст (html)" required | ||
27 | rows="10">{{ old('text') ?? $program->text ?? '' }}</textarea> | ||
28 | @error('text') | ||
29 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
30 | {{ $message }} | ||
31 | </span> | ||
32 | @enderror | ||
33 | </label><br> | ||
34 | |||
35 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | ||
36 | <div> | ||
37 | <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> | ||
38 | Сохранить | ||
39 | </button> | ||
40 | </div> | ||
41 | </div> | ||
42 | </div> | ||
43 | </form> | ||
44 | |||
45 | @endsection | ||
46 |
routes/web.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use App\Http\Controllers\AdEmployerController; | 3 | use App\Http\Controllers\AdEmployerController; |
4 | use App\Http\Controllers\Admin\AdminController; | 4 | use App\Http\Controllers\Admin\AdminController; |
5 | use App\Http\Controllers\Admin\CategoryController; | 5 | use App\Http\Controllers\Admin\CategoryController; |
6 | use App\Http\Controllers\Admin\CategoryEmpController; | 6 | use App\Http\Controllers\Admin\CategoryEmpController; |
7 | use App\Http\Controllers\Admin\EducationController; | 7 | use App\Http\Controllers\Admin\EducationController; |
8 | use App\Http\Controllers\Admin\EmployersController; | 8 | use App\Http\Controllers\Admin\EmployersController; |
9 | use App\Http\Controllers\Admin\InfoBloksController; | 9 | use App\Http\Controllers\Admin\InfoBloksController; |
10 | use App\Http\Controllers\Admin\JobTitlesController; | 10 | use App\Http\Controllers\Admin\JobTitlesController; |
11 | use App\Http\Controllers\Admin\UsersController; | 11 | use App\Http\Controllers\Admin\UsersController; |
12 | use App\Http\Controllers\Admin\WorkersController; | 12 | use App\Http\Controllers\Admin\WorkersController; |
13 | use App\Http\Controllers\Auth\ForgotPasswordController; | 13 | use App\Http\Controllers\Auth\ForgotPasswordController; |
14 | use App\Http\Controllers\Auth\LoginController; | 14 | use App\Http\Controllers\Auth\LoginController; |
15 | use App\Http\Controllers\Auth\RegisterController; | 15 | use App\Http\Controllers\Auth\RegisterController; |
16 | use App\Http\Controllers\CKEditorController; | 16 | use App\Http\Controllers\CKEditorController; |
17 | use App\Http\Controllers\MediaController; | 17 | use App\Http\Controllers\MediaController; |
18 | use App\Http\Controllers\WorkerController; | 18 | use App\Http\Controllers\WorkerController; |
19 | use App\Models\User; | 19 | use App\Models\User; |
20 | use App\Http\Controllers\MainController; | 20 | use App\Http\Controllers\MainController; |
21 | use App\Http\Controllers\HomeController; | 21 | use App\Http\Controllers\HomeController; |
22 | use Illuminate\Support\Facades\Route; | 22 | use Illuminate\Support\Facades\Route; |
23 | use App\Http\Controllers\Admin\CompanyController; | 23 | use App\Http\Controllers\Admin\CompanyController; |
24 | use App\Http\Controllers\Admin\Ad_EmployersController; | 24 | use App\Http\Controllers\Admin\Ad_EmployersController; |
25 | use App\Http\Controllers\Admin\MsgAnswersController; | 25 | use App\Http\Controllers\Admin\MsgAnswersController; |
26 | use App\Http\Controllers\Admin\GroupsController; | 26 | use App\Http\Controllers\Admin\GroupsController; |
27 | use App\Http\Controllers\PagesController; | 27 | use App\Http\Controllers\PagesController; |
28 | use Illuminate\Support\Facades\Storage; | 28 | use Illuminate\Support\Facades\Storage; |
29 | 29 | ||
30 | 30 | ||
31 | /* | 31 | /* |
32 | |-------------------------------------------------------------------------- | 32 | |-------------------------------------------------------------------------- |
33 | | Web Routes | 33 | | Web Routes |
34 | |-------------------------------------------------------------------------- | 34 | |-------------------------------------------------------------------------- |
35 | | | 35 | | |
36 | | Here is where you can register web routes for your application. These | 36 | | Here is where you can register web routes for your application. These |
37 | | routes are loaded by the RouteServiceProvider within a group which | 37 | | routes are loaded by the RouteServiceProvider within a group which |
38 | | contains the "web" middleware group. Now create something great! | 38 | | contains the "web" middleware group. Now create something great! |
39 | | | 39 | | |
40 | */ | 40 | */ |
41 | /* | 41 | /* |
42 | Route::get('/', function () { | 42 | Route::get('/', function () { |
43 | return view('welcome'); | 43 | return view('welcome'); |
44 | })->name('index'); | 44 | })->name('index'); |
45 | */ | 45 | */ |
46 | Route::get('/', [MainController::class, 'index'])->name('index'); | 46 | Route::get('/', [MainController::class, 'index'])->name('index'); |
47 | 47 | ||
48 | //Роуты авторизации, регистрации, восстановления, аутентификации | 48 | //Роуты авторизации, регистрации, восстановления, аутентификации |
49 | Auth::routes(['verify' => true]); | 49 | Auth::routes(['verify' => true]); |
50 | 50 | ||
51 | // роуты регистрации, авторизации, восстановления пароля, верификации почты | 51 | // роуты регистрации, авторизации, восстановления пароля, верификации почты |
52 | /*Route::group([ | 52 | /*Route::group([ |
53 | 'as' => 'auth.', //имя маршрута, например auth.index | 53 | 'as' => 'auth.', //имя маршрута, например auth.index |
54 | 'prefix' => 'auth', // префикс маршрута, например, auth/index | 54 | 'prefix' => 'auth', // префикс маршрута, например, auth/index |
55 | ], function () { | 55 | ], function () { |
56 | //форма регистрации | 56 | //форма регистрации |
57 | Route::get('register', [RegisterController::class, 'register'])->name('register'); | 57 | Route::get('register', [RegisterController::class, 'register'])->name('register'); |
58 | 58 | ||
59 | //создание пользователя | 59 | //создание пользователя |
60 | Route::post('register', [RegisterController::class, 'create'])->name('create'); | 60 | Route::post('register', [RegisterController::class, 'create'])->name('create'); |
61 | 61 | ||
62 | //форма входа авторизации | 62 | //форма входа авторизации |
63 | Route::get('login', [LoginController::class, 'login'])->name('login'); | 63 | Route::get('login', [LoginController::class, 'login'])->name('login'); |
64 | 64 | ||
65 | //аутентификация | 65 | //аутентификация |
66 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); | 66 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); |
67 | 67 | ||
68 | //выход | 68 | //выход |
69 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); | 69 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); |
70 | 70 | ||
71 | //форма ввода адреса почты | 71 | //форма ввода адреса почты |
72 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); | 72 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); |
73 | 73 | ||
74 | //письмо на почту | 74 | //письмо на почту |
75 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); | 75 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); |
76 | 76 | ||
77 | //форма восстановления пароля | 77 | //форма восстановления пароля |
78 | Route::get('reset-password/token/{token}/email/{email}', | 78 | Route::get('reset-password/token/{token}/email/{email}', |
79 | [ResetPasswordController::class, 'form'] | 79 | [ResetPasswordController::class, 'form'] |
80 | )->name('reset-form'); | 80 | )->name('reset-form'); |
81 | 81 | ||
82 | //восстановление пароля | 82 | //восстановление пароля |
83 | Route::post('reset-password', | 83 | Route::post('reset-password', |
84 | [ResetPasswordController::class, 'reset'] | 84 | [ResetPasswordController::class, 'reset'] |
85 | )->name('reset-password'); | 85 | )->name('reset-password'); |
86 | 86 | ||
87 | //сообщение о необходимости проверки адреса почты | 87 | //сообщение о необходимости проверки адреса почты |
88 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); | 88 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); |
89 | 89 | ||
90 | //подтверждение адреса почты нового пользователя | 90 | //подтверждение адреса почты нового пользователя |
91 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) | 91 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) |
92 | ->where('token', '[a-f0-9]{32}') | 92 | ->where('token', '[a-f0-9]{32}') |
93 | ->where('id', '[0-9]+') | 93 | ->where('id', '[0-9]+') |
94 | ->name('verify-email'); | 94 | ->name('verify-email'); |
95 | });*/ | 95 | });*/ |
96 | 96 | ||
97 | //Личный кабинет пользователя | 97 | //Личный кабинет пользователя |
98 | Route::get('/home', [HomeController::class, 'index'])->name('home'); | 98 | Route::get('/home', [HomeController::class, 'index'])->name('home'); |
99 | 99 | ||
100 | /* | 100 | /* |
101 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { | 101 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { |
102 | $user = User::where('email',$request->input('email'))->first(); | 102 | $user = User::where('email',$request->input('email'))->first(); |
103 | 103 | ||
104 | $user->sendEmailVerificationNotification(); | 104 | $user->sendEmailVerificationNotification(); |
105 | 105 | ||
106 | return 'your response'; | 106 | return 'your response'; |
107 | })->middleware('throttle:6,1')->name('verification.resend'); | 107 | })->middleware('throttle:6,1')->name('verification.resend'); |
108 | */ | 108 | */ |
109 | 109 | ||
110 | // Авторизация, регистрация в админку | 110 | // Авторизация, регистрация в админку |
111 | Route::group([ | 111 | Route::group([ |
112 | 'as' => 'admin.', // имя маршрута, например auth.index | 112 | 'as' => 'admin.', // имя маршрута, например auth.index |
113 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 113 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
114 | 'middleware' => ['guest'], | 114 | 'middleware' => ['guest'], |
115 | ], function () { | 115 | ], function () { |
116 | // Форма регистрации | 116 | // Форма регистрации |
117 | Route::get('register', [AdminController::class, 'register'])->name('register'); | 117 | Route::get('register', [AdminController::class, 'register'])->name('register'); |
118 | // Создание пользователя | 118 | // Создание пользователя |
119 | Route::post('register', [AdminController::class, 'create'])->name('create'); | 119 | Route::post('register', [AdminController::class, 'create'])->name('create'); |
120 | 120 | ||
121 | //Форма входа | 121 | //Форма входа |
122 | Route::get('login', [AdminController::class, 'login'])->name('login'); | 122 | Route::get('login', [AdminController::class, 'login'])->name('login'); |
123 | 123 | ||
124 | // аутентификация | 124 | // аутентификация |
125 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); | 125 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); |
126 | 126 | ||
127 | }); | 127 | }); |
128 | 128 | ||
129 | // Личный кабинет админки | 129 | // Личный кабинет админки |
130 | Route::group([ | 130 | Route::group([ |
131 | 'as' => 'admin.', // имя маршрута, например auth.index | 131 | 'as' => 'admin.', // имя маршрута, например auth.index |
132 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 132 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
133 | 'middleware' => ['auth'], ['admin'], | 133 | 'middleware' => ['auth'], ['admin'], |
134 | ], function() { | 134 | ], function() { |
135 | 135 | ||
136 | // выход | 136 | // выход |
137 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); | 137 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); |
138 | 138 | ||
139 | // кабинет главная страница | 139 | // кабинет главная страница |
140 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); | 140 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); |
141 | 141 | ||
142 | // кабинет профиль админа - форма | 142 | // кабинет профиль админа - форма |
143 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); | 143 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); |
144 | // кабинет профиль админа - сохранение формы | 144 | // кабинет профиль админа - сохранение формы |
145 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); | 145 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); |
146 | 146 | ||
147 | //кабинет сообщения админа | 147 | //кабинет сообщения админа |
148 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); | 148 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); |
149 | 149 | ||
150 | 150 | ||
151 | // кабинет профиль - форма пароли | 151 | // кабинет профиль - форма пароли |
152 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); | 152 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); |
153 | // кабинет профиль - сохранение формы пароля | 153 | // кабинет профиль - сохранение формы пароля |
154 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); | 154 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); |
155 | 155 | ||
156 | 156 | ||
157 | // кабинет профиль пользователя - форма | 157 | // кабинет профиль пользователя - форма |
158 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); | 158 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); |
159 | // кабинет профиль пользователя - сохранение формы | 159 | // кабинет профиль пользователя - сохранение формы |
160 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); | 160 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); |
161 | 161 | ||
162 | // кабинет профиль работодатель - форма | 162 | // кабинет профиль работодатель - форма |
163 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); | 163 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); |
164 | // кабинет профиль работодатель - сохранение формы | 164 | // кабинет профиль работодатель - сохранение формы |
165 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); | 165 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); |
166 | // кабинет удаление профиль работодателя и юзера | 166 | // кабинет удаление профиль работодателя и юзера |
167 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); | 167 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); |
168 | 168 | ||
169 | // кабинет профиль работник - форма | 169 | // кабинет профиль работник - форма |
170 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); | 170 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); |
171 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); | 171 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); |
172 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); | 172 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); |
173 | // кабинет профиль работник - сохранение формы | 173 | // кабинет профиль работник - сохранение формы |
174 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); | 174 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); |
175 | 175 | ||
176 | // Медиа | 176 | // Медиа |
177 | Route::get('media', [MediaController::class, 'index'])->name('media'); | 177 | Route::get('media', [MediaController::class, 'index'])->name('media'); |
178 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); | 178 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); |
179 | 179 | ||
180 | // кабинет настройки сайта - форма | 180 | // кабинет настройки сайта - форма |
181 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); | 181 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); |
182 | // кабинет настройки сайта сохранение формы | 182 | // кабинет настройки сайта сохранение формы |
183 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); | 183 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); |
184 | 184 | ||
185 | // кабинет - пользователи | 185 | // кабинет - пользователи |
186 | Route::get('users', [UsersController::class, 'index'])->name('users'); | 186 | Route::get('users', [UsersController::class, 'index'])->name('users'); |
187 | 187 | ||
188 | // кабинет - пользователи | 188 | // кабинет - пользователи |
189 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); | 189 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); |
190 | 190 | ||
191 | // кабинет - работодатели | 191 | // кабинет - работодатели |
192 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); | 192 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); |
193 | 193 | ||
194 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); | 194 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); |
195 | 195 | ||
196 | // кабинет - соискатели | 196 | // кабинет - соискатели |
197 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); | 197 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); |
198 | 198 | ||
199 | // кабинет - база данных | 199 | // кабинет - база данных |
200 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); | 200 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); |
201 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); | 201 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); |
202 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); | 202 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); |
203 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); | 203 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); |
204 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); | 204 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); |
205 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); | 205 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); |
206 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); | 206 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); |
207 | 207 | ||
208 | // кабинет - вакансии | 208 | // кабинет - вакансии |
209 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); | 209 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); |
210 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); | 210 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); |
211 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); | 211 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); |
212 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); | 212 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); |
213 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); | 213 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); |
214 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); | 214 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); |
215 | 215 | ||
216 | // кабинет - категории | 216 | // кабинет - категории |
217 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); | 217 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); |
218 | /* | 218 | /* |
219 | * CRUD-операции над Справочником Категории | 219 | * CRUD-операции над Справочником Категории |
220 | */ | 220 | */ |
221 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); | 221 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); |
222 | 222 | ||
223 | // CRUD-операции над справочником Категории для работодателей | 223 | // CRUD-операции над справочником Категории для работодателей |
224 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); | 224 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); |
225 | 225 | ||
226 | // CRUD-операции над справочником Образование | 226 | // CRUD-операции над справочником Образование |
227 | Route::resource('education', EducationController::class, ['except' => ['show']]); | 227 | Route::resource('education', EducationController::class, ['except' => ['show']]); |
228 | 228 | ||
229 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); | 229 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); |
230 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); | 230 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); |
231 | |||
232 | Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); | ||
233 | Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); | ||
234 | |||
231 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); | 235 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); |
232 | 236 | ||
233 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); | 237 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); |
234 | /* | 238 | /* |
235 | * кабинет - CRUD-операции по справочнику должности | 239 | * кабинет - CRUD-операции по справочнику должности |
236 | * | 240 | * |
237 | */ | 241 | */ |
238 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); | 242 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); |
239 | 243 | ||
240 | // кабинет - сообщения (чтение чужих) | 244 | // кабинет - сообщения (чтение чужих) |
241 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); | 245 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); |
242 | // кабинет - просмотр сообщения чужого (чтение) | 246 | // кабинет - просмотр сообщения чужого (чтение) |
243 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); | 247 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); |
244 | 248 | ||
245 | // кабинет - сообщения (админские) | 249 | // кабинет - сообщения (админские) |
246 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); | 250 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); |
247 | // кабинет - сообщения (админские) | 251 | // кабинет - сообщения (админские) |
248 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); | 252 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); |
249 | // кабинет - sql - конструкция запросов | 253 | // кабинет - sql - конструкция запросов |
250 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); | 254 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); |
251 | 255 | ||
252 | /* | 256 | /* |
253 | * Расписанный подход в описании каждой директорий групп пользователей. | 257 | * Расписанный подход в описании каждой директорий групп пользователей. |
254 | */ | 258 | */ |
255 | // кабинет - группы пользователей | 259 | // кабинет - группы пользователей |
256 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); | 260 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); |
257 | // кабинет - добавление форма группы пользователей | 261 | // кабинет - добавление форма группы пользователей |
258 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); | 262 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); |
259 | // кабинет - сохранение формы группы пользователей | 263 | // кабинет - сохранение формы группы пользователей |
260 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); | 264 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); |
261 | // кабинет - редактирование форма группы пользователей | 265 | // кабинет - редактирование форма группы пользователей |
262 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); | 266 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); |
263 | // кабинет - сохранение редактированной формы группы пользователей | 267 | // кабинет - сохранение редактированной формы группы пользователей |
264 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); | 268 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); |
265 | // кабинет - удаление группы пользователей | 269 | // кабинет - удаление группы пользователей |
266 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); | 270 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); |
267 | 271 | ||
268 | 272 | ||
269 | // кабинет - список админов | 273 | // кабинет - список админов |
270 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); | 274 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); |
271 | 275 | ||
272 | 276 | ||
273 | /////редактор////// кабинет - редактор сайта//////////////////////// | 277 | /////редактор////// кабинет - редактор сайта//////////////////////// |
274 | Route::get('editor-site', function() { | 278 | Route::get('editor-site', function() { |
275 | return view('admin.editor.index'); | 279 | return view('admin.editor.index'); |
276 | })->name('editor-site'); | 280 | })->name('editor-site'); |
277 | 281 | ||
278 | 282 | ||
279 | // кабинет - редактор шапки-футера сайта | 283 | // кабинет - редактор шапки-футера сайта |
280 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); | 284 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); |
281 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); | 285 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); |
282 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); | 286 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); |
283 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); | 287 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); |
284 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); | 288 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); |
285 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); | 289 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); |
286 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); | 290 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); |
287 | 291 | ||
288 | 292 | ||
289 | // кабинет - редактор должности на главной | 293 | // кабинет - редактор должности на главной |
290 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); | 294 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); |
291 | 295 | ||
292 | // кабинет - редактор работодатели на главной | 296 | // кабинет - редактор работодатели на главной |
293 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); | 297 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); |
294 | 298 | ||
295 | 299 | ||
296 | // кабинет - редактор seo-сайта | 300 | // кабинет - редактор seo-сайта |
297 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); | 301 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); |
298 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); | 302 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); |
299 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); | 303 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); |
300 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); | 304 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); |
301 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); | 305 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); |
302 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); | 306 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); |
303 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); | 307 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); |
304 | 308 | ||
305 | 309 | ||
306 | // кабинет - редактор страниц | 310 | // кабинет - редактор страниц |
307 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); | 311 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); |
308 | // кабинет - добавление страницы | 312 | // кабинет - добавление страницы |
309 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); | 313 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); |
310 | // кабинет - сохранение формы страницы | 314 | // кабинет - сохранение формы страницы |
311 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); | 315 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); |
312 | // кабинет - редактирование форма страницы | 316 | // кабинет - редактирование форма страницы |
313 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); | 317 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); |
314 | // кабинет - сохранение редактированной формы страницы | 318 | // кабинет - сохранение редактированной формы страницы |
315 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); | 319 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); |
316 | // кабинет - удаление страницы | 320 | // кабинет - удаление страницы |
317 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); | 321 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); |
318 | 322 | ||
319 | 323 | ||
320 | // кабинет - реклама сайта | 324 | // кабинет - реклама сайта |
321 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); | 325 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); |
322 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); | 326 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); |
323 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); | 327 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); |
324 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); | 328 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); |
325 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); | 329 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); |
326 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); | 330 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); |
327 | //////////////////////////////////////////////////////////////////////// | 331 | //////////////////////////////////////////////////////////////////////// |
328 | 332 | ||
329 | 333 | ||
330 | // кабинет - отзывы о работодателе для модерации | 334 | // кабинет - отзывы о работодателе для модерации |
331 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); | 335 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); |
332 | 336 | ||
333 | // Общая страница статистики | 337 | // Общая страница статистики |
334 | Route::get('statics', function () { | 338 | Route::get('statics', function () { |
335 | return view('admin.static.index'); | 339 | return view('admin.static.index'); |
336 | })->name('statics'); | 340 | })->name('statics'); |
337 | 341 | ||
338 | // кабинет - статистика работников | 342 | // кабинет - статистика работников |
339 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); | 343 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); |
340 | 344 | ||
341 | // кабинет - статистика вакансий работодателя | 345 | // кабинет - статистика вакансий работодателя |
342 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); | 346 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); |
343 | 347 | ||
344 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника | 348 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника |
345 | /* | 349 | /* |
346 | * CRUD-операции над справочником дипломы и документы | 350 | * CRUD-операции над справочником дипломы и документы |
347 | */ | 351 | */ |
348 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); | 352 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); |
349 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); | 353 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); |
350 | 354 | ||
351 | // кабинет - роли пользователя | 355 | // кабинет - роли пользователя |
352 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); | 356 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); |
353 | 357 | ||
354 | Route::get('logs', function() { | 358 | Route::get('logs', function() { |
355 | $files = Storage::files('logs/laravel.log'); | 359 | $files = Storage::files('logs/laravel.log'); |
356 | print_r($files); | 360 | print_r($files); |
357 | })->name('logs'); | 361 | })->name('logs'); |
358 | 362 | ||
359 | }); | 363 | }); |
360 | 364 | ||
361 | // Инструментальные страницы | 365 | // Инструментальные страницы |
362 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); | 366 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); |
363 | 367 | ||
364 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); | 368 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); |
365 | 369 | ||
366 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); | 370 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); |
367 | 371 | ||
368 | // Страницы с произвольным контентом | 372 | // Страницы с произвольным контентом |
369 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); | 373 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); |
370 | 374 | ||
371 | // Публичные страницы соискателя | 375 | // Публичные страницы соискателя |
372 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); | 376 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); |
373 | 377 | ||
374 | //Страница вакансии | 378 | //Страница вакансии |
375 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); | 379 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); |
376 | 380 |