Commit 46be695f582eddf57b3be55715f7272835f1d84b
1 parent
eb8596db66
Exists in
master
and in
1 other branch
Образование и специализации в учебных заведениях
Showing 6 changed files with 119 additions and 11 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 | /*$program1 = ProgramEducation::query()->where('education_id', '=', $education->id) | ||
74 | ->where('level', '=', '1')->get(); | ||
75 | $program2 = ProgramEducation::query()->where('education_id', '=', $education->id) | ||
76 | ->where('level', '=', '2')->get(); | ||
77 | $program3 = ProgramEducation::query()->where('education_id', '=', $education->id) | ||
78 | ->where('level', '=', '3')->get(); | ||
79 | */ | ||
80 | |||
81 | $program = ProgramEducation::query()->where('education_id', '=', $education->id) | 73 | $program = ProgramEducation::query()->where('education_id', '=', $education->id) |
82 | ->orderBy('level')->get(); | 74 | ->orderBy('level')->get(); |
83 | |||
84 | return view('admin.education.edit', compact('education', 'program')); | 75 | return view('admin.education.edit', compact('education', 'program')); |
85 | } | 76 | } |
86 | 77 | ||
87 | /** | 78 | /** |
88 | * Update the specified resource in storage. | 79 | * Update the specified resource in storage. |
89 | * | 80 | * |
90 | * @param \Illuminate\Http\Request $request | 81 | * @param \Illuminate\Http\Request $request |
91 | * @param \App\Models\Education $education | 82 | * @param \App\Models\Education $education |
92 | * @return \Illuminate\Http\Response | 83 | * @return \Illuminate\Http\Response |
93 | */ | 84 | */ |
94 | public function update(EducationRequest $request, Education $education) | 85 | public function update(EducationRequest $request, Education $education) |
95 | { | 86 | { |
96 | $params = $request->all(); | 87 | $params = $request->all(); |
97 | if ($request->has('image')) { | 88 | if ($request->has('image')) { |
98 | if (!empty($education->image)) { | 89 | if (!empty($education->image)) { |
99 | Storage::delete($education->image); | 90 | Storage::delete($education->image); |
100 | } | 91 | } |
101 | $params['image'] = $request->file('image')->store("education", 'public'); | 92 | $params['image'] = $request->file('image')->store("education", 'public'); |
102 | } | 93 | } |
103 | 94 | ||
104 | $education->update($params); | 95 | $education->update($params); |
105 | return redirect()->route('admin.education.index'); | 96 | return redirect()->route('admin.education.index'); |
106 | } | 97 | } |
107 | 98 | ||
108 | /** | 99 | /** |
109 | * Remove the specified resource from storage. | 100 | * Remove the specified resource from storage. |
110 | * | 101 | * |
111 | * @param \App\Models\Education $education | 102 | * @param \App\Models\Education $education |
112 | * @return \Illuminate\Http\Response | 103 | * @return \Illuminate\Http\Response |
113 | */ | 104 | */ |
114 | public function destroy(Education $education) | 105 | public function destroy(Education $education) |
115 | { | 106 | { |
116 | $education->update(['is_remove' => 1]); | 107 | $education->update(['is_remove' => 1]); |
117 | return redirect()->route('admin.education.index'); | 108 | return redirect()->route('admin.education.index'); |
118 | } | 109 | } |
119 | 110 | ||
120 | public function add_program(Request $request) { | 111 | public function add_program(Request $request) { |
121 | $id_education = $request->id; | 112 | $id_education = $request->id; |
122 | $level = $request->level; | 113 | $level = $request->level; |
123 | return view('admin.education.program', compact('id_education', 'level')); | 114 | return view('admin.education.program', compact('id_education', 'level')); |
124 | } | 115 | } |
125 | 116 | ||
126 | public function store_program(ProgramEducationRequest $request) { | 117 | public function store_program(ProgramEducationRequest $request) { |
127 | $education = $request->education_id; | 118 | $education = $request->education_id; |
128 | ProgramEducation::create($request->all()); | 119 | ProgramEducation::create($request->all()); |
129 | 120 | ||
130 | return redirect()->route('admin.education.edit', ['education' => $education]); | 121 | return redirect()->route('admin.education.edit', ['education' => $education]); |
131 | } | 122 | } |
132 | 123 | ||
124 | public function delete_program(ProgramEducation $program, Education $education) { | ||
125 | $education = $education->id; |
resources/views/admin/education/add.blade.php
1 | @extends('layout.admin', ['title' => 'Админка - Добавление образования']) | 1 | @extends('layout.admin', ['title' => 'Админка - Добавление образования']) |
2 | 2 | ||
3 | @section('content') | 3 | @section('content') |
4 | <form method="POST" action="{{ route('admin.education.store') }}" enctype="multipart/form-data"> | 4 | <form method="POST" action="{{ route('admin.education.store') }}" enctype="multipart/form-data"> |
5 | @include('admin.education.form') | 5 | @include('admin.education.form-add') |
6 | </form> | 6 | </form> |
7 | @endsection | 7 | @endsection |
8 | 8 |
resources/views/admin/education/form-add.blade.php
File was created | 1 | @csrf | |
2 | |||
3 | @isset($education) | ||
4 | @method('PUT') | ||
5 | @endisset | ||
6 | |||
7 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | ||
8 | <label class="block text-sm"> | ||
9 | <span class="text-gray-700 dark:text-gray-400">Название учебного заведения</span> | ||
10 | <input name="name" id="name" | ||
11 | 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 | placeholder="Название учебного заведения" value="{{ old('name') ?? $education->name ?? '' }}" | ||
13 | /> | ||
14 | @error('name') | ||
15 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
16 | {{ $message }} | ||
17 | </span> | ||
18 | @enderror | ||
19 | </label><br> | ||
20 | |||
21 | <label class="block text-sm"> | ||
22 | <span class="text-gray-700 dark:text-gray-400">Адрес</span> | ||
23 | <input name="address" id="address" | ||
24 | 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" | ||
25 | placeholder="Адрес" value="{{ old('address') ?? $education->address ?? '' }}" | ||
26 | /> | ||
27 | @error('address') | ||
28 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
29 | {{ $message }} | ||
30 | </span> | ||
31 | @enderror | ||
32 | </label><br> | ||
33 | |||
34 | <label class="block text-sm"> | ||
35 | <span class="text-gray-700 dark:text-gray-400">Email</span> | ||
36 | <input name="email" id="email" | ||
37 | 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" | ||
38 | placeholder="Email" value="{{ old('email') ?? $education->email ?? '' }}" | ||
39 | /> | ||
40 | @error('email') | ||
41 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
42 | {{ $message }} | ||
43 | </span> | ||
44 | @enderror | ||
45 | </label><br> | ||
46 | |||
47 | <label class="block text-sm"> | ||
48 | <span class="text-gray-700 dark:text-gray-400">Телефон</span> | ||
49 | <input name="telephone" id="telephone" | ||
50 | 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" | ||
51 | placeholder="Телефон" value="{{ old('telephone') ?? $education->telephone ?? '' }}" | ||
52 | /> | ||
53 | @error('telephone') | ||
54 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
55 | {{ $message }} | ||
56 | </span> | ||
57 | @enderror | ||
58 | </label><br> | ||
59 | |||
60 | <label class="block text-sm"> | ||
61 | <span class="text-gray-700 dark:text-gray-400">Текст</span> | ||
62 | <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 | ||
63 | rows="10">{{ old('text') ?? $education->text ?? '' }}</textarea> | ||
64 | @error('text') | ||
65 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
66 | {{ $message }} | ||
67 | </span> | ||
68 | @enderror | ||
69 | </label><br> | ||
70 | |||
71 | <label class="block text-sm"> | ||
72 | <span class="text-gray-700 dark:text-gray-400">Картинка</span> | ||
73 | <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 | ||
74 | focus:border-purple-400 focus:outline-none focus:shadow-outline-purple | ||
75 | dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | ||
76 | id="image" name="image" accept="image/png, image/jpeg"> | ||
77 | @error('image') | ||
78 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
79 | {{ $message }} | ||
80 | </span> | ||
81 | @enderror | ||
82 | @isset($education->image) | ||
83 | <img src="{{asset(Storage::url($education->image))}}" width="100px"/> | ||
84 | @endisset | ||
85 | </label><br> | ||
86 | |||
87 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | ||
88 | <div> | ||
89 | <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"> | ||
90 | Сохранить | ||
91 | </button> | ||
92 | <a href="{{ route('admin.education.index') }}" | ||
93 | 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" | ||
94 | style="display: -webkit-inline-box; height: 30px!important;" | ||
95 | >Назад</a> | ||
96 | </div> | ||
97 | </div> | ||
98 | </div> | ||
99 | <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> | ||
100 | |||
101 | <!--<script src="{{ asset('./ckeditor/ckeditor.js') }}"></script>--> | ||
102 | <script> | ||
103 | CKEDITOR.replace( 'text', { | ||
104 | filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", | ||
105 | filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", | ||
106 | filebrowserUploadMethod: 'form' | ||
107 | }); | ||
108 | </script> | ||
109 |
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 | <input name="address" id="address" | 24 | <input name="address" id="address" |
25 | 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" | 25 | 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" |
26 | placeholder="Адрес" value="{{ old('address') ?? $education->address ?? '' }}" | 26 | placeholder="Адрес" value="{{ old('address') ?? $education->address ?? '' }}" |
27 | /> | 27 | /> |
28 | @error('address') | 28 | @error('address') |
29 | <span class="text-xs text-red-600 dark:text-red-400"> | 29 | <span class="text-xs text-red-600 dark:text-red-400"> |
30 | {{ $message }} | 30 | {{ $message }} |
31 | </span> | 31 | </span> |
32 | @enderror | 32 | @enderror |
33 | </label><br> | 33 | </label><br> |
34 | 34 | ||
35 | <label class="block text-sm"> | 35 | <label class="block text-sm"> |
36 | <span class="text-gray-700 dark:text-gray-400">Email</span> | 36 | <span class="text-gray-700 dark:text-gray-400">Email</span> |
37 | <input name="email" id="email" | 37 | <input name="email" id="email" |
38 | 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" | 38 | 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" |
39 | placeholder="Email" value="{{ old('email') ?? $education->email ?? '' }}" | 39 | placeholder="Email" value="{{ old('email') ?? $education->email ?? '' }}" |
40 | /> | 40 | /> |
41 | @error('email') | 41 | @error('email') |
42 | <span class="text-xs text-red-600 dark:text-red-400"> | 42 | <span class="text-xs text-red-600 dark:text-red-400"> |
43 | {{ $message }} | 43 | {{ $message }} |
44 | </span> | 44 | </span> |
45 | @enderror | 45 | @enderror |
46 | </label><br> | 46 | </label><br> |
47 | 47 | ||
48 | <label class="block text-sm"> | 48 | <label class="block text-sm"> |
49 | <span class="text-gray-700 dark:text-gray-400">Телефон</span> | 49 | <span class="text-gray-700 dark:text-gray-400">Телефон</span> |
50 | <input name="telephone" id="telephone" | 50 | <input name="telephone" id="telephone" |
51 | 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" | 51 | 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" |
52 | placeholder="Телефон" value="{{ old('telephone') ?? $education->telephone ?? '' }}" | 52 | placeholder="Телефон" value="{{ old('telephone') ?? $education->telephone ?? '' }}" |
53 | /> | 53 | /> |
54 | @error('telephone') | 54 | @error('telephone') |
55 | <span class="text-xs text-red-600 dark:text-red-400"> | 55 | <span class="text-xs text-red-600 dark:text-red-400"> |
56 | {{ $message }} | 56 | {{ $message }} |
57 | </span> | 57 | </span> |
58 | @enderror | 58 | @enderror |
59 | </label><br> | 59 | </label><br> |
60 | 60 | ||
61 | <label class="block text-sm"> | 61 | <label class="block text-sm"> |
62 | <span class="text-gray-700 dark:text-gray-400">Текст</span> | 62 | <span class="text-gray-700 dark:text-gray-400">Текст</span> |
63 | <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 | 63 | <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 |
64 | rows="10">{{ old('text') ?? $education->text ?? '' }}</textarea> | 64 | rows="10">{{ old('text') ?? $education->text ?? '' }}</textarea> |
65 | @error('text') | 65 | @error('text') |
66 | <span class="text-xs text-red-600 dark:text-red-400"> | 66 | <span class="text-xs text-red-600 dark:text-red-400"> |
67 | {{ $message }} | 67 | {{ $message }} |
68 | </span> | 68 | </span> |
69 | @enderror | 69 | @enderror |
70 | </label><br> | 70 | </label><br> |
71 | 71 | ||
72 | <label class="block text-sm"> | 72 | <label class="block text-sm"> |
73 | <span class="text-gray-700 dark:text-gray-400">Картинка</span> | 73 | <span class="text-gray-700 dark:text-gray-400">Картинка</span> |
74 | <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 | 74 | <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 |
75 | focus:border-purple-400 focus:outline-none focus:shadow-outline-purple | 75 | focus:border-purple-400 focus:outline-none focus:shadow-outline-purple |
76 | dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 76 | dark:text-gray-300 dark:focus:shadow-outline-gray form-input" |
77 | id="image" name="image" accept="image/png, image/jpeg"> | 77 | id="image" name="image" accept="image/png, image/jpeg"> |
78 | @error('image') | 78 | @error('image') |
79 | <span class="text-xs text-red-600 dark:text-red-400"> | 79 | <span class="text-xs text-red-600 dark:text-red-400"> |
80 | {{ $message }} | 80 | {{ $message }} |
81 | </span> | 81 | </span> |
82 | @enderror | 82 | @enderror |
83 | @isset($education->image) | 83 | @isset($education->image) |
84 | <img src="{{asset(Storage::url($education->image))}}" width="100px"/> | 84 | <img src="{{asset(Storage::url($education->image))}}" width="100px"/> |
85 | @endisset | 85 | @endisset |
86 | </label><br> | 86 | </label><br> |
87 | 87 | ||
88 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | 88 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> |
89 | <div> | 89 | <div> |
90 | <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"> | 90 | <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"> |
91 | Сохранить | 91 | Сохранить |
92 | </button> | 92 | </button> |
93 | <a href="{{ route('admin.education.index') }}" | 93 | <a href="{{ route('admin.education.index') }}" |
94 | 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" | 94 | 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" |
95 | style="display: -webkit-inline-box; height: 30px!important;" | 95 | style="display: -webkit-inline-box; height: 30px!important;" |
96 | >Назад</a> | 96 | >Назад</a> |
97 | </div> | 97 | </div> |
98 | </div> | 98 | </div> |
99 | </form> | 99 | </form> |
100 | 100 | ||
101 | @isset($education) | 101 | @isset($education) |
102 | <hr> | 102 | <hr> |
103 | <form method="GET" action="{{ route('admin.add-program-education') }}"> | 103 | <form method="GET" action="{{ route('admin.add-program-education') }}"> |
104 | <label class="block text-sm"> | 104 | <label class="block text-sm"> |
105 | <span class="text-gray-700 dark:text-gray-400">Категория образования</span> | 105 | <span class="text-gray-700 dark:text-gray-400">Категория образования</span> |
106 | <input type="hidden" name="id" value="{{ $education->id }}"/> | 106 | <input type="hidden" name="id" value="{{ $education->id }}"/> |
107 | <input name="level" id="level" | 107 | <input name="level" id="level" |
108 | 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" | 108 | 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" |
109 | placeholder="Новое образование" value="" | 109 | placeholder="Новое образование" value="" |
110 | /><br> | 110 | /><br> |
111 | <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"> | 111 | <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"> |
112 | Добавить | 112 | Добавить |
113 | </button> | 113 | </button> |
114 | </label><br> | 114 | </label><br> |
115 | </form> | 115 | </form> |
116 | <hr> | 116 | <hr> |
117 | @if ($program->count()) | 117 | @if ($program->count()) |
118 | @php $bool = true; | 118 | @php $bool = true; |
119 | $i = 1; | 119 | $i = 1; |
120 | $level = ""; | 120 | $level = ""; |
121 | @endphp | 121 | @endphp |
122 | 122 | ||
123 | @foreach ($program as $pro) | 123 | @foreach ($program as $pro) |
124 | @if ((!empty($level)) && ($level <> $pro->level )) | 124 | @if ((!empty($level)) && ($level <> $pro->level )) |
125 | </div> | 125 | </div> |
126 | </div><br> | 126 | </div><br> |
127 | @php $bool = true; $i++; @endphp | 127 | @php $bool = true; $i++; @endphp |
128 | @endif | 128 | @endif |
129 | @if ($bool == true) | 129 | @if ($bool == true) |
130 | <div class="tabs"> | 130 | <div class="tabs"> |
131 | <input type="radio" name="tab-btn" id="tab-btn-{{$i}}" value="" checked> | 131 | <input type="radio" name="tab-btn" id="tab-btn-{{$i}}" value="" checked> |
132 | <label for="tab-btn-{{$i}}">{{ $pro->level }}</label> | 132 | <label for="tab-btn-{{$i}}">{{ $pro->level }}</label> |
133 | <div id="content-{{$i}}"> | 133 | <div id="content-{{$i}}"> |
134 | 134 | ||
135 | @php $bool = false; | 135 | @php $bool = false; |
136 | $level = $pro->level; | 136 | $level = $pro->level; |
137 | @endphp | 137 | @endphp |
138 | @endif | 138 | @endif |
139 | <label class="block text-sm"> | 139 | <label class="block text-sm"> |
140 | <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300">Специальность: {{$pro->name}}</h4> | 140 | <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300">Специальность: {{$pro->name}}</h4> |
141 | <span class="text-gray-700 dark:text-gray-400">Описание: {{$pro->text}}</span> | 141 | <span class="text-gray-700 dark:text-gray-400">Описание: {{$pro->text}}</span> |
142 | <a href="{{ route('admin.delete-program-education', ['program' => $pro->id, 'education' => $education->id]) }}">Удалить</a> | ||
142 | </label><br><hr> | 143 | </label><br><hr> |
143 | @endforeach | 144 | @endforeach |
144 | </div> | 145 | </div> |
145 | </div><br> | 146 | </div><br> |
146 | @else | 147 | @else |
147 | <span class="text-gray-700 dark:text-gray-400">Нет записей</span> | 148 | <span class="text-gray-700 dark:text-gray-400">Нет записей</span> |
148 | @endif | 149 | @endif |
149 | @endisset | 150 | @endisset |
150 | 151 | ||
151 | </div> | 152 | </div> |
152 | <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> | 153 | <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> |
153 | 154 | ||
154 | <!--<script src="{{ asset('./ckeditor/ckeditor.js') }}"></script>--> | 155 | <!--<script src="{{ asset('./ckeditor/ckeditor.js') }}"></script>--> |
155 | <script> | 156 | <script> |
156 | CKEDITOR.replace( 'text', { | 157 | CKEDITOR.replace( 'text', { |
157 | filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", | 158 | filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", |
158 | filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", | 159 | filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", |
159 | filebrowserUploadMethod: 'form' | 160 | filebrowserUploadMethod: 'form' |
160 | }); | 161 | }); |
161 | </script> | 162 | </script> |
162 | 163 |
resources/views/admin/education/index.blade.php
1 | @extends('layout.admin', ['title' => 'Админка - Справочник образование']) | 1 | @extends('layout.admin', ['title' => 'Админка - Справочник образование']) |
2 | 2 | ||
3 | @section('script') | 3 | @section('script') |
4 | 4 | ||
5 | @endsection | 5 | @endsection |
6 | 6 | ||
7 | @section('search') | 7 | @section('search') |
8 | 8 | ||
9 | @endsection | 9 | @endsection |
10 | 10 | ||
11 | @section('content') | 11 | @section('content') |
12 | 12 | ||
13 | <a href="{{ route('admin.education.create') }}" style="width: 195px" 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"> | 13 | <a href="{{ route('admin.education.create') }}" style="width: 195px" 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"> |
14 | Добавить образование | 14 | Добавить образование |
15 | </a> | 15 | </a> |
16 | <br> | 16 | <br> |
17 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 17 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
18 | 18 | ||
19 | <div class="w-full overflow-x-auto"> | 19 | <div class="w-full overflow-x-auto"> |
20 | <table class="w-full whitespace-no-wrap"> | 20 | <table class="w-full whitespace-no-wrap"> |
21 | <thead> | 21 | <thead> |
22 | <tr | 22 | <tr |
23 | 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" | 23 | 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" |
24 | > | 24 | > |
25 | <th class="px-4 py-3">№</th> | 25 | <th class="px-4 py-3">№</th> |
26 | <th class="px-4 py-3">Название образования</th> | 26 | <th class="px-4 py-3">Название образования</th> |
27 | <th class="px-4 py-3">Редактировать</th> | 27 | <th class="px-4 py-3">Редактировать</th> |
28 | <th class="px-4 py-3">Дата создания</th> | 28 | <th class="px-4 py-3">Дата создания</th> |
29 | </tr> | 29 | </tr> |
30 | </thead> | 30 | </thead> |
31 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 31 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
32 | @foreach($education as $cat) | 32 | @foreach($education as $cat) |
33 | <tr class="text-gray-700 dark:text-gray-400"> | 33 | <tr class="text-gray-700 dark:text-gray-400"> |
34 | <td class="px-4 py-3"> | 34 | <td class="px-4 py-3"> |
35 | {{$cat->id}} | 35 | {{$cat->id}} |
36 | </td> | 36 | </td> |
37 | <td class="px-4 py-3"> | 37 | <td class="px-4 py-3"> |
38 | {{ $cat->name }} | 38 | {{ mb_strimwidth($cat->name, 0, 50, "...") }} |
39 | </td> | 39 | </td> |
40 | 40 | ||
41 | <td class="px-4 py-3 text-sm_"> | 41 | <td class="px-4 py-3 text-sm_"> |
42 | <form action="{{ route('admin.education.destroy', ['education' => $cat->id]) }}" method="POST"> | 42 | <form action="{{ route('admin.education.destroy', ['education' => $cat->id]) }}" method="POST"> |
43 | <a href="{{ route('admin.education.edit', ['education' => $cat->id]) }}">Изменить</a> | | 43 | <a href="{{ route('admin.education.edit', ['education' => $cat->id]) }}">Изменить</a> | |
44 | @csrf | 44 | @csrf |
45 | @method('DELETE') | 45 | @method('DELETE') |
46 | <input class="btn btn-danger" type="submit" value="Удалить"/> | 46 | <input class="btn btn-danger" type="submit" value="Удалить"/> |
47 | </form> | 47 | </form> |
48 | </td> | 48 | </td> |
49 | <td class="px-4 py-3"> | 49 | <td class="px-4 py-3"> |
50 | {{ date('d.m.Y', strtotime($cat->created_at))}} | 50 | {{ date('d.m.Y', strtotime($cat->created_at))}} |
51 | </td> | 51 | </td> |
52 | </tr> | 52 | </tr> |
53 | @endforeach | 53 | @endforeach |
54 | </tbody> | 54 | </tbody> |
55 | </table> | 55 | </table> |
56 | </div> | 56 | </div> |
57 | 57 | ||
58 | <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"> | 58 | <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"> |
59 | <?=$education->appends($_GET)->links('admin.pagginate'); ?> | 59 | <?=$education->appends($_GET)->links('admin.pagginate'); ?> |
60 | </div> | 60 | </div> |
61 | </div> | 61 | </div> |
62 | @endsection | 62 | @endsection |
63 | 63 |
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 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); | ||
231 | 232 | ||
232 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); | 233 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); |
233 | /* | 234 | /* |
234 | * кабинет - CRUD-операции по справочнику должности | 235 | * кабинет - CRUD-операции по справочнику должности |
235 | * | 236 | * |
236 | */ | 237 | */ |
237 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); | 238 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); |
238 | 239 | ||
239 | // кабинет - сообщения (чтение чужих) | 240 | // кабинет - сообщения (чтение чужих) |
240 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); | 241 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); |
241 | // кабинет - просмотр сообщения чужого (чтение) | 242 | // кабинет - просмотр сообщения чужого (чтение) |
242 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); | 243 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); |
243 | 244 | ||
244 | // кабинет - сообщения (админские) | 245 | // кабинет - сообщения (админские) |
245 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); | 246 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); |
246 | // кабинет - сообщения (админские) | 247 | // кабинет - сообщения (админские) |
247 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); | 248 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); |
248 | // кабинет - sql - конструкция запросов | 249 | // кабинет - sql - конструкция запросов |
249 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); | 250 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); |
250 | 251 | ||
251 | /* | 252 | /* |
252 | * Расписанный подход в описании каждой директорий групп пользователей. | 253 | * Расписанный подход в описании каждой директорий групп пользователей. |
253 | */ | 254 | */ |
254 | // кабинет - группы пользователей | 255 | // кабинет - группы пользователей |
255 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); | 256 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); |
256 | // кабинет - добавление форма группы пользователей | 257 | // кабинет - добавление форма группы пользователей |
257 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); | 258 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); |
258 | // кабинет - сохранение формы группы пользователей | 259 | // кабинет - сохранение формы группы пользователей |
259 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); | 260 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); |
260 | // кабинет - редактирование форма группы пользователей | 261 | // кабинет - редактирование форма группы пользователей |
261 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); | 262 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); |
262 | // кабинет - сохранение редактированной формы группы пользователей | 263 | // кабинет - сохранение редактированной формы группы пользователей |
263 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); | 264 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); |
264 | // кабинет - удаление группы пользователей | 265 | // кабинет - удаление группы пользователей |
265 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); | 266 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); |
266 | 267 | ||
267 | 268 | ||
268 | // кабинет - список админов | 269 | // кабинет - список админов |
269 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); | 270 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); |
270 | 271 | ||
271 | 272 | ||
272 | /////редактор////// кабинет - редактор сайта//////////////////////// | 273 | /////редактор////// кабинет - редактор сайта//////////////////////// |
273 | Route::get('editor-site', function() { | 274 | Route::get('editor-site', function() { |
274 | return view('admin.editor.index'); | 275 | return view('admin.editor.index'); |
275 | })->name('editor-site'); | 276 | })->name('editor-site'); |
276 | 277 | ||
277 | 278 | ||
278 | // кабинет - редактор шапки-футера сайта | 279 | // кабинет - редактор шапки-футера сайта |
279 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); | 280 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); |
280 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); | 281 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); |
281 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); | 282 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); |
282 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); | 283 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); |
283 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); | 284 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); |
284 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); | 285 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); |
285 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); | 286 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); |
286 | 287 | ||
287 | 288 | ||
288 | // кабинет - редактор должности на главной | 289 | // кабинет - редактор должности на главной |
289 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); | 290 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); |
290 | 291 | ||
291 | // кабинет - редактор работодатели на главной | 292 | // кабинет - редактор работодатели на главной |
292 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); | 293 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); |
293 | 294 | ||
294 | 295 | ||
295 | // кабинет - редактор seo-сайта | 296 | // кабинет - редактор seo-сайта |
296 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); | 297 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); |
297 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); | 298 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); |
298 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); | 299 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); |
299 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); | 300 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); |
300 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); | 301 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); |
301 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); | 302 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); |
302 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); | 303 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); |
303 | 304 | ||
304 | 305 | ||
305 | // кабинет - редактор страниц | 306 | // кабинет - редактор страниц |
306 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); | 307 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); |
307 | // кабинет - добавление страницы | 308 | // кабинет - добавление страницы |
308 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); | 309 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); |
309 | // кабинет - сохранение формы страницы | 310 | // кабинет - сохранение формы страницы |
310 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); | 311 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); |
311 | // кабинет - редактирование форма страницы | 312 | // кабинет - редактирование форма страницы |
312 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); | 313 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); |
313 | // кабинет - сохранение редактированной формы страницы | 314 | // кабинет - сохранение редактированной формы страницы |
314 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); | 315 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); |
315 | // кабинет - удаление страницы | 316 | // кабинет - удаление страницы |
316 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); | 317 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); |
317 | 318 | ||
318 | 319 | ||
319 | // кабинет - реклама сайта | 320 | // кабинет - реклама сайта |
320 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); | 321 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); |
321 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); | 322 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); |
322 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); | 323 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); |
323 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); | 324 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); |
324 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); | 325 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); |
325 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); | 326 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); |
326 | //////////////////////////////////////////////////////////////////////// | 327 | //////////////////////////////////////////////////////////////////////// |
327 | 328 | ||
328 | 329 | ||
329 | // кабинет - отзывы о работодателе для модерации | 330 | // кабинет - отзывы о работодателе для модерации |
330 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); | 331 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); |
331 | 332 | ||
332 | // Общая страница статистики | 333 | // Общая страница статистики |
333 | Route::get('statics', function () { | 334 | Route::get('statics', function () { |
334 | return view('admin.static.index'); | 335 | return view('admin.static.index'); |
335 | })->name('statics'); | 336 | })->name('statics'); |
336 | 337 | ||
337 | // кабинет - статистика работников | 338 | // кабинет - статистика работников |
338 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); | 339 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); |
339 | 340 | ||
340 | // кабинет - статистика вакансий работодателя | 341 | // кабинет - статистика вакансий работодателя |
341 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); | 342 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); |
342 | 343 | ||
343 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника | 344 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника |
344 | /* | 345 | /* |
345 | * CRUD-операции над справочником дипломы и документы | 346 | * CRUD-операции над справочником дипломы и документы |
346 | */ | 347 | */ |
347 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); | 348 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); |
348 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); | 349 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); |
349 | 350 | ||
350 | // кабинет - роли пользователя | 351 | // кабинет - роли пользователя |
351 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); | 352 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); |
352 | 353 | ||
353 | Route::get('logs', function() { | 354 | Route::get('logs', function() { |
354 | $files = Storage::files('logs/laravel.log'); | 355 | $files = Storage::files('logs/laravel.log'); |
355 | print_r($files); | 356 | print_r($files); |
356 | })->name('logs'); | 357 | })->name('logs'); |
357 | 358 | ||
358 | }); | 359 | }); |
359 | 360 | ||
360 | // Инструментальные страницы | 361 | // Инструментальные страницы |
361 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); | 362 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); |
362 | 363 | ||
363 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); | 364 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); |
364 | 365 | ||
365 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); | 366 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); |
366 | 367 | ||
367 | // Страницы с произвольным контентом | 368 | // Страницы с произвольным контентом |
368 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); | 369 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); |
369 | 370 | ||
370 | // Публичные страницы соискателя | 371 | // Публичные страницы соискателя |
371 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); | 372 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); |
372 | 373 | ||
373 | //Страница вакансии | 374 | //Страница вакансии |
374 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); | 375 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); |
375 | 376 |