Commit f3f96e3932c28cc2b3e61fb80914886dccaea606
1 parent
79fe45e455
Exists in
master
and in
1 other branch
Результат финал
Showing 3 changed files with 6 additions and 6 deletions Inline Diff
app/Http/Controllers/Admin/JobTitlesController.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\JobTitlesRequest; | 6 | use App\Http\Requests\JobTitlesRequest; |
7 | use App\Models\Category; | 7 | use App\Models\Category; |
8 | use App\Models\Job_title; | 8 | use App\Models\Job_title; |
9 | use App\Models\Positions; | 9 | use App\Models\Positions; |
10 | use Illuminate\Http\Request; | 10 | use Illuminate\Http\Request; |
11 | 11 | ||
12 | class JobTitlesController extends Controller | 12 | class JobTitlesController extends Controller |
13 | { | 13 | { |
14 | /** | 14 | /** |
15 | * Display a listing of the resource. | 15 | * Display a listing of the resource. |
16 | * | 16 | * |
17 | * @return \Illuminate\Http\Response | 17 | * @return \Illuminate\Http\Response |
18 | */ | 18 | */ |
19 | public function index() | 19 | public function index() |
20 | { | 20 | { |
21 | $Jobs = Job_title::query()->orderBy('name')->active()->paginate(15); | 21 | $Jobs = Job_title::query()->orderBy('name')->paginate(15); |
22 | return view('admin.job_titles.index', compact('Jobs')); | 22 | return view('admin.job_titles.index', compact('Jobs')); |
23 | } | 23 | } |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * Show the form for creating a new resource. | 26 | * Show the form for creating a new resource. |
27 | * | 27 | * |
28 | * @return \Illuminate\Http\Response | 28 | * @return \Illuminate\Http\Response |
29 | */ | 29 | */ |
30 | public function create() | 30 | public function create() |
31 | { | 31 | { |
32 | /*$items = Job_title::query()-> | 32 | /*$items = Job_title::query()-> |
33 | orderByDesc('sort')-> | 33 | orderByDesc('sort')-> |
34 | orderBy('name')-> | 34 | orderBy('name')-> |
35 | active()-> | 35 | active()-> |
36 | get();*/ | 36 | get();*/ |
37 | $category = Category::query()->get(); | 37 | $category = Category::query()->get(); |
38 | 38 | ||
39 | return view('admin.job_titles.add', compact('category')); | 39 | return view('admin.job_titles.add', compact('category')); |
40 | } | 40 | } |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Store a newly created resource in storage. | 43 | * Store a newly created resource in storage. |
44 | * | 44 | * |
45 | * @param \Illuminate\Http\Request $request | 45 | * @param \Illuminate\Http\Request $request |
46 | * @return \Illuminate\Http\Response | 46 | * @return \Illuminate\Http\Response |
47 | */ | 47 | */ |
48 | public function store(JobTitlesRequest $request) | 48 | public function store(JobTitlesRequest $request) |
49 | { | 49 | { |
50 | Job_title::create($request->all()); | 50 | Job_title::create($request->all()); |
51 | return redirect()->route('admin.job-titles.index'); | 51 | return redirect()->route('admin.job-titles.index'); |
52 | } | 52 | } |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * Display the specified resource. | 55 | * Display the specified resource. |
56 | * | 56 | * |
57 | * @param \App\Models\Job_title $job_title | 57 | * @param \App\Models\Job_title $job_title |
58 | * @return \Illuminate\Http\Response | 58 | * @return \Illuminate\Http\Response |
59 | */ | 59 | */ |
60 | public function show(Job_title $job_title) | 60 | public function show(Job_title $job_title) |
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\Job_title $job_title | 68 | * @param \App\Models\Job_title $job_title |
69 | * @return \Illuminate\Http\Response | 69 | * @return \Illuminate\Http\Response |
70 | */ | 70 | */ |
71 | public function edit(Job_title $job_title) | 71 | public function edit(Job_title $job_title) |
72 | { | 72 | { |
73 | $category = Category::query()->get(); | 73 | $category = Category::query()->get(); |
74 | return view('admin.job_titles.edit', compact('job_title', 'category')); | 74 | return view('admin.job_titles.edit', compact('job_title', 'category')); |
75 | } | 75 | } |
76 | 76 | ||
77 | /** | 77 | /** |
78 | * Update the specified resource in storage. | 78 | * Update the specified resource in storage. |
79 | * | 79 | * |
80 | * @param \Illuminate\Http\Request $request | 80 | * @param \Illuminate\Http\Request $request |
81 | * @param \App\Models\Job_title $job_title | 81 | * @param \App\Models\Job_title $job_title |
82 | * @return \Illuminate\Http\Response | 82 | * @return \Illuminate\Http\Response |
83 | */ | 83 | */ |
84 | public function update(JobTitlesRequest $request, Job_title $job_title) | 84 | public function update(JobTitlesRequest $request, Job_title $job_title) |
85 | { | 85 | { |
86 | $job_title->update($request->all()); | 86 | $job_title->update($request->all()); |
87 | return redirect()->route('admin.job-titles.index'); | 87 | return redirect()->route('admin.job-titles.index'); |
88 | } | 88 | } |
89 | 89 | ||
90 | /** | 90 | /** |
91 | * Remove the specified resource from storage. | 91 | * Remove the specified resource from storage. |
92 | * | 92 | * |
93 | * @param \App\Models\Job_title $job_title | 93 | * @param \App\Models\Job_title $job_title |
94 | * @return \Illuminate\Http\Response | 94 | * @return \Illuminate\Http\Response |
95 | */ | 95 | */ |
96 | public function destroy(Job_title $job_title) | 96 | public function destroy(Job_title $job_title) |
97 | { | 97 | { |
98 | $job_title->update(['is_remove' => 1]); | 98 | $job_title->update(['is_remove' => 1]); |
99 | return redirect()->route('admin.job-titles.index'); | 99 | return redirect()->route('admin.job-titles.index'); |
100 | } | 100 | } |
101 | } | 101 | } |
102 | 102 |
app/Http/Controllers/MainController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Classes\RusDate; | 5 | use App\Classes\RusDate; |
6 | use App\Classes\Tools; | 6 | use App\Classes\Tools; |
7 | use App\Mail\MailRegistration; | 7 | use App\Mail\MailRegistration; |
8 | use App\Mail\MailRepair; | 8 | use App\Mail\MailRepair; |
9 | use App\Models\Ad_employer; | 9 | use App\Models\Ad_employer; |
10 | use App\Models\Ad_jobs; | 10 | use App\Models\Ad_jobs; |
11 | use App\Models\Category; | 11 | use App\Models\Category; |
12 | use App\Models\Education; | 12 | use App\Models\Education; |
13 | use App\Models\Employer; | 13 | use App\Models\Employer; |
14 | use App\Models\employers_main; | 14 | use App\Models\employers_main; |
15 | use App\Models\Job_title; | 15 | use App\Models\Job_title; |
16 | use App\Models\Like_vacancy; | 16 | use App\Models\Like_vacancy; |
17 | use App\Models\Like_worker; | 17 | use App\Models\Like_worker; |
18 | use App\Models\News; | 18 | use App\Models\News; |
19 | use App\Models\Positions; | 19 | use App\Models\Positions; |
20 | use App\Models\reclame; | 20 | use App\Models\reclame; |
21 | use App\Models\User; | 21 | use App\Models\User; |
22 | use Illuminate\Http\Request; | 22 | use Illuminate\Http\Request; |
23 | use Illuminate\Support\Facades\Auth; | 23 | use Illuminate\Support\Facades\Auth; |
24 | use Illuminate\Support\Facades\DB; | 24 | use Illuminate\Support\Facades\DB; |
25 | use Illuminate\Support\Facades\Hash; | 25 | use Illuminate\Support\Facades\Hash; |
26 | use Illuminate\Support\Facades\Mail; | 26 | use Illuminate\Support\Facades\Mail; |
27 | use Illuminate\Support\Facades\Validator; | 27 | use Illuminate\Support\Facades\Validator; |
28 | use App\Classes\StatusUser; | 28 | use App\Classes\StatusUser; |
29 | 29 | ||
30 | class MainController extends Controller | 30 | class MainController extends Controller |
31 | { | 31 | { |
32 | // Главная страница публичной части | 32 | // Главная страница публичной части |
33 | public function index() { | 33 | public function index() { |
34 | $news = News::query()->orderBy('id')->limit(6)->get(); | 34 | $news = News::query()->orderBy('id')->limit(6)->get(); |
35 | 35 | ||
36 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') | 36 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') |
37 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') | 37 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') |
38 | ->OrderByDesc('created_at') | 38 | ->OrderByDesc('created_at') |
39 | ->GroupBy('categories.id') | 39 | ->GroupBy('categories.id') |
40 | ->get(); | 40 | ->get(); |
41 | 41 | ||
42 | $Position = Category::query()->get(); | 42 | $Position = Category::query()->where('is_remove', '=', '0')->get(); |
43 | 43 | ||
44 | /*$BigFlot = Array(); | 44 | /*$BigFlot = Array(); |
45 | foreach ($Position as $position) { | 45 | foreach ($Position as $position) { |
46 | $BigFlot[] = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> | 46 | $BigFlot[] = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> |
47 | orderBy('job_titles.sort')-> | 47 | orderBy('job_titles.sort')-> |
48 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | 48 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> |
49 | where('position_ship', "$position->name")-> | 49 | where('position_ship', "$position->name")-> |
50 | groupby('job_title_id','position_ship')-> | 50 | groupby('job_title_id','position_ship')-> |
51 | get(); | 51 | get(); |
52 | } | 52 | } |
53 | 53 | ||
54 | $BigFlot = Array(); | 54 | $BigFlot = Array(); |
55 | 55 | ||
56 | foreach ($Position as $position) { | 56 | foreach ($Position as $position) { |
57 | 57 | ||
58 | $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) { | 58 | $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) { |
59 | $query->OrderBy('sort'); | 59 | $query->OrderBy('sort'); |
60 | }])->whereHas('job_title', function ($query) use ($position) { | 60 | }])->whereHas('job_title', function ($query) use ($position) { |
61 | $query->where('position_id', $position->id); | 61 | $query->where('position_id', $position->id); |
62 | })-> | 62 | })-> |
63 | distinct('job_title_id')-> | 63 | distinct('job_title_id')-> |
64 | get(); | 64 | get(); |
65 | }*/ | 65 | }*/ |
66 | 66 | ||
67 | $BigFlot = Array(); | 67 | $BigFlot = Array(); |
68 | foreach ($Position as $position) { | 68 | foreach ($Position as $position) { |
69 | $BigFlot[] = DB::table('ad_jobs')-> | 69 | $BigFlot[] = DB::table('ad_jobs')-> |
70 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> | 70 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> |
71 | orderByDesc('job_titles.sort')-> | 71 | orderByDesc('job_titles.sort')-> |
72 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | 72 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> |
73 | where('job_titles.position_id', $position->id)-> | 73 | where('job_titles.position_id', $position->id)-> |
74 | groupby('job_title_id')-> | 74 | groupby('job_title_id')-> |
75 | get(); | 75 | get(); |
76 | } | 76 | } |
77 | 77 | ||
78 | $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); | 78 | $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); |
79 | $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); | 79 | $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); |
80 | return view('index', compact('news', 'categories', 'employers', 'vacancy', 'BigFlot', 'Position')); | 80 | return view('index', compact('news', 'categories', 'employers', 'vacancy', 'BigFlot', 'Position')); |
81 | } | 81 | } |
82 | 82 | ||
83 | public function search_vacancies(Request $request) { | 83 | public function search_vacancies(Request $request) { |
84 | if ($request->has('search')) { | 84 | if ($request->has('search')) { |
85 | $search = $request->get('search'); | 85 | $search = $request->get('search'); |
86 | $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); | 86 | $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); |
87 | if (isset($job_titles->id)) | 87 | if (isset($job_titles->id)) |
88 | if ($job_titles->id > 0) | 88 | if ($job_titles->id > 0) |
89 | return redirect()->route('vacancies', ['job' => $job_titles->id]); | 89 | return redirect()->route('vacancies', ['job' => $job_titles->id]); |
90 | } | 90 | } |
91 | } | 91 | } |
92 | 92 | ||
93 | // Лайк вакансии | 93 | // Лайк вакансии |
94 | public function like_vacancy(Request $request) { | 94 | public function like_vacancy(Request $request) { |
95 | $IP_address = RusDate::ip_addr_client(); | 95 | $IP_address = RusDate::ip_addr_client(); |
96 | 96 | ||
97 | if ($request->has('code_record')) { | 97 | if ($request->has('code_record')) { |
98 | if ($request->has('delete')) { | 98 | if ($request->has('delete')) { |
99 | $atomic_era = Like_vacancy::select('id')-> | 99 | $atomic_era = Like_vacancy::select('id')-> |
100 | where('code_record', '=', $request-> | 100 | where('code_record', '=', $request-> |
101 | get('code_record'))->first(); | 101 | get('code_record'))->first(); |
102 | 102 | ||
103 | DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); | 103 | DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); |
104 | 104 | ||
105 | } else { | 105 | } else { |
106 | $params = $request->all(); | 106 | $params = $request->all(); |
107 | $params['ip_address'] = $IP_address; | 107 | $params['ip_address'] = $IP_address; |
108 | Like_vacancy::create($params); | 108 | Like_vacancy::create($params); |
109 | } | 109 | } |
110 | } | 110 | } |
111 | } | 111 | } |
112 | 112 | ||
113 | // Лайк соискателю. | 113 | // Лайк соискателю. |
114 | public function like_worker(Request $request) { | 114 | public function like_worker(Request $request) { |
115 | $IP_address = RusDate::ip_addr_client(); | 115 | $IP_address = RusDate::ip_addr_client(); |
116 | 116 | ||
117 | if ($request->has('code_record')) { | 117 | if ($request->has('code_record')) { |
118 | if ($request->has('delete')) { | 118 | if ($request->has('delete')) { |
119 | $atomic_era = Like_worker::select('id')-> | 119 | $atomic_era = Like_worker::select('id')-> |
120 | where('code_record', '=', $request-> | 120 | where('code_record', '=', $request-> |
121 | get('code_record'))->first(); | 121 | get('code_record'))->first(); |
122 | 122 | ||
123 | DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete(); | 123 | DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete(); |
124 | 124 | ||
125 | return "Вот и результат удаления!"; | 125 | return "Вот и результат удаления!"; |
126 | 126 | ||
127 | } else { | 127 | } else { |
128 | $params = $request->all(); | 128 | $params = $request->all(); |
129 | $params['ip_address'] = $IP_address; | 129 | $params['ip_address'] = $IP_address; |
130 | Like_worker::create($params); | 130 | Like_worker::create($params); |
131 | } | 131 | } |
132 | } | 132 | } |
133 | } | 133 | } |
134 | 134 | ||
135 | 135 | ||
136 | public function vacancies(Request $request) { | 136 | public function vacancies(Request $request) { |
137 | //должности | 137 | //должности |
138 | $Job_title = Job_title::query()->orderBy('name')->get(); | 138 | $Job_title = Job_title::query()->orderBy('name')->get(); |
139 | 139 | ||
140 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') | 140 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') |
141 | ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') | 141 | ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') |
142 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') | 142 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') |
143 | ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); | 143 | ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); |
144 | 144 | ||
145 | //категории и вакансии | 145 | //категории и вакансии |
146 | if (($request->has('job')) && ($request->get('job') > 0)) { | 146 | if (($request->has('job')) && ($request->get('job') > 0)) { |
147 | $categories = $categories->Where('job_title_id', '=', $request->get('job')); | 147 | $categories = $categories->Where('job_title_id', '=', $request->get('job')); |
148 | } | 148 | } |
149 | 149 | ||
150 | $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); | 150 | $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); |
151 | 151 | ||
152 | $Position = Category::query()->get(); | 152 | $Position = Category::query()->where('is_remove', '=', '0')->get(); |
153 | 153 | ||
154 | /*$BigFlot = Array(); | 154 | /*$BigFlot = Array(); |
155 | foreach ($Position as $position) { | 155 | foreach ($Position as $position) { |
156 | $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> | 156 | $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> |
157 | orderBy('job_titles.sort')-> | 157 | orderBy('job_titles.sort')-> |
158 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | 158 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> |
159 | where('position_ship', "$position->name"); | 159 | where('position_ship', "$position->name"); |
160 | if (($request->has('job')) && ($request->get('job') > 0)) { | 160 | if (($request->has('job')) && ($request->get('job') > 0)) { |
161 | $War_flot = $War_flot->where('job_title_id', $request->get('job')); | 161 | $War_flot = $War_flot->where('job_title_id', $request->get('job')); |
162 | } | 162 | } |
163 | $War_flot = $War_flot->groupby('job_title_id','position_ship')->get(); | 163 | $War_flot = $War_flot->groupby('job_title_id','position_ship')->get(); |
164 | $BigFlot[] = $War_flot; | 164 | $BigFlot[] = $War_flot; |
165 | }*/ | 165 | }*/ |
166 | 166 | ||
167 | $BigFlot = Array(); | 167 | $BigFlot = Array(); |
168 | foreach ($Position as $position) { | 168 | foreach ($Position as $position) { |
169 | $WarFlot = DB::table('ad_jobs')-> | 169 | $WarFlot = DB::table('ad_jobs')-> |
170 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> | 170 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> |
171 | orderByDesc('job_titles.sort')-> | 171 | orderByDesc('job_titles.sort')-> |
172 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | 172 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> |
173 | where('job_titles.position_id', $position->id); | 173 | where('job_titles.position_id', $position->id); |
174 | if (($request->has('job')) && ($request->get('job') > 0)) { | 174 | if (($request->has('job')) && ($request->get('job') > 0)) { |
175 | $WarFlot = $WarFlot->where('job_title_id', $request->get('job')); | 175 | $WarFlot = $WarFlot->where('job_title_id', $request->get('job')); |
176 | } | 176 | } |
177 | $WarFlot = $WarFlot->groupby('job_title_id')->get(); | 177 | $WarFlot = $WarFlot->groupby('job_title_id')->get(); |
178 | $BigFlot[] = $WarFlot; | 178 | $BigFlot[] = $WarFlot; |
179 | } | 179 | } |
180 | 180 | ||
181 | if ($request->ajax()) { | 181 | if ($request->ajax()) { |
182 | return view('ajax.new_sky', compact('categories', 'BigFlot', 'Position')); | 182 | return view('ajax.new_sky', compact('categories', 'BigFlot', 'Position')); |
183 | } else { | 183 | } else { |
184 | return view('new_sky', compact('Job_title', 'categories', 'BigFlot', 'Position')); | 184 | return view('new_sky', compact('Job_title', 'categories', 'BigFlot', 'Position')); |
185 | } | 185 | } |
186 | } | 186 | } |
187 | 187 | ||
188 | //Вакансии категория детальная | 188 | //Вакансии категория детальная |
189 | public function list_vacancies(Category $categories, Request $request) { | 189 | public function list_vacancies(Category $categories, Request $request) { |
190 | if (isset(Auth()->user()->id)) | 190 | if (isset(Auth()->user()->id)) |
191 | $uid = Auth()->user()->id; | 191 | $uid = Auth()->user()->id; |
192 | else | 192 | else |
193 | $uid = 0; | 193 | $uid = 0; |
194 | 194 | ||
195 | $Query = Ad_employer::with('jobs')-> | 195 | $Query = Ad_employer::with('jobs')-> |
196 | with('cat')-> | 196 | with('cat')-> |
197 | with('employer')-> | 197 | with('employer')-> |
198 | whereHas('jobs_code', function ($query) use ($request) { | 198 | whereHas('jobs_code', function ($query) use ($request) { |
199 | if (null !== ($request->get('job')) && ($request->get('job') !== 0)) { | 199 | if (null !== ($request->get('job')) && ($request->get('job') !== 0)) { |
200 | $query->where('job_title_id', $request->get('job')); | 200 | $query->where('job_title_id', $request->get('job')); |
201 | } | 201 | } |
202 | }) | 202 | }) |
203 | ->select('ad_employers.*'); | 203 | ->select('ad_employers.*'); |
204 | 204 | ||
205 | 205 | ||
206 | if (isset($categories->id) && ($categories->id > 0)) { | 206 | if (isset($categories->id) && ($categories->id > 0)) { |
207 | $Query = $Query->where('category_id', '=', $categories->id); | 207 | $Query = $Query->where('category_id', '=', $categories->id); |
208 | $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); | 208 | $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); |
209 | } else { | 209 | } else { |
210 | $Name_categori = ''; | 210 | $Name_categori = ''; |
211 | } | 211 | } |
212 | 212 | ||
213 | if ($request->get('sort')) { | 213 | if ($request->get('sort')) { |
214 | $sort = $request->get('sort'); | 214 | $sort = $request->get('sort'); |
215 | 215 | ||
216 | 216 | ||
217 | switch ($sort) { | 217 | switch ($sort) { |
218 | case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; | 218 | case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; |
219 | case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; | 219 | case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; |
220 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; | 220 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; |
221 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; | 221 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; |
222 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 222 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
223 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 223 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | $Job_title = Job_title::query()->OrderBy('name')->get(); | 227 | $Job_title = Job_title::query()->OrderBy('name')->get(); |
228 | 228 | ||
229 | $Query_count = $Query->count(); | 229 | $Query_count = $Query->count(); |
230 | 230 | ||
231 | $Query = $Query->OrderBy('updated_at')->paginate(3); | 231 | $Query = $Query->OrderBy('updated_at')->paginate(3); |
232 | 232 | ||
233 | $Reclama = reclame::query()->get(); | 233 | $Reclama = reclame::query()->get(); |
234 | 234 | ||
235 | 235 | ||
236 | 236 | ||
237 | if ($request->ajax()) { | 237 | if ($request->ajax()) { |
238 | if ($request->has('title')) { | 238 | if ($request->has('title')) { |
239 | return view('ajax.list_category', compact( | 239 | return view('ajax.list_category', compact( |
240 | 'Name_categori' | 240 | 'Name_categori' |
241 | )); | 241 | )); |
242 | } else { | 242 | } else { |
243 | return view('ajax.list_vacancies', compact('Query', | 243 | return view('ajax.list_vacancies', compact('Query', |
244 | 'Query_count', | 244 | 'Query_count', |
245 | 'Name_categori', | 245 | 'Name_categori', |
246 | 'Reclama', | 246 | 'Reclama', |
247 | 'categories', | 247 | 'categories', |
248 | 'Job_title', | 248 | 'Job_title', |
249 | 'uid')); | 249 | 'uid')); |
250 | } | 250 | } |
251 | } else { | 251 | } else { |
252 | //Вернуть все | 252 | //Вернуть все |
253 | return view('list_vacancies', compact('Query', | 253 | return view('list_vacancies', compact('Query', |
254 | 'Query_count', | 254 | 'Query_count', |
255 | 'Reclama', | 255 | 'Reclama', |
256 | 'Name_categori', | 256 | 'Name_categori', |
257 | 'categories', | 257 | 'categories', |
258 | 'Job_title', | 258 | 'Job_title', |
259 | 'uid')); | 259 | 'uid')); |
260 | } | 260 | } |
261 | } | 261 | } |
262 | 262 | ||
263 | // Образование | 263 | // Образование |
264 | public function education(Request $request) { | 264 | public function education(Request $request) { |
265 | $educations = Education::query(); | 265 | $educations = Education::query(); |
266 | if (($request->has('search')) && (!empty($request->get('search')))) { | 266 | if (($request->has('search')) && (!empty($request->get('search')))) { |
267 | $search = trim($request->get('search')); | 267 | $search = trim($request->get('search')); |
268 | $educations = $educations->where('name', 'LIKE', "%$search%"); | 268 | $educations = $educations->where('name', 'LIKE', "%$search%"); |
269 | } | 269 | } |
270 | 270 | ||
271 | if ($request->get('sort')) { | 271 | if ($request->get('sort')) { |
272 | $sort = $request->get('sort'); | 272 | $sort = $request->get('sort'); |
273 | switch ($sort) { | 273 | switch ($sort) { |
274 | case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; | 274 | case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; |
275 | case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; | 275 | case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; |
276 | case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; | 276 | case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; |
277 | case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; | 277 | case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; |
278 | case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; | 278 | case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; |
279 | default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; | 279 | default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; |
280 | } | 280 | } |
281 | } | 281 | } |
282 | 282 | ||
283 | $count_edu = $educations->count(); | 283 | $count_edu = $educations->count(); |
284 | $educations = $educations->paginate(6); | 284 | $educations = $educations->paginate(6); |
285 | if ($request->ajax()) { | 285 | if ($request->ajax()) { |
286 | return view('ajax.education', compact('educations')); | 286 | return view('ajax.education', compact('educations')); |
287 | } else { | 287 | } else { |
288 | return view('education', compact('educations', 'count_edu')); | 288 | return view('education', compact('educations', 'count_edu')); |
289 | } | 289 | } |
290 | } | 290 | } |
291 | 291 | ||
292 | // Контакты | 292 | // Контакты |
293 | public function contacts() { | 293 | public function contacts() { |
294 | return view('contacts'); | 294 | return view('contacts'); |
295 | } | 295 | } |
296 | 296 | ||
297 | // Вход в личный кабинет | 297 | // Вход в личный кабинет |
298 | public function input_login(Request $request) | 298 | public function input_login(Request $request) |
299 | { | 299 | { |
300 | $params = $request->all(); | 300 | $params = $request->all(); |
301 | 301 | ||
302 | 302 | ||
303 | $rules = [ | 303 | $rules = [ |
304 | 'email' => 'required|string|email', | 304 | 'email' => 'required|string|email', |
305 | 'password' => 'required|string|min:3|max:25', | 305 | 'password' => 'required|string|min:3|max:25', |
306 | ]; | 306 | ]; |
307 | 307 | ||
308 | $messages = [ | 308 | $messages = [ |
309 | 'required' => 'Укажите обязательное поле «:attribute»', | 309 | 'required' => 'Укажите обязательное поле «:attribute»', |
310 | 'email' => 'Введите корректный email', | 310 | 'email' => 'Введите корректный email', |
311 | 'min' => [ | 311 | 'min' => [ |
312 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 312 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
313 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 313 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
314 | ], | 314 | ], |
315 | 'max' => [ | 315 | 'max' => [ |
316 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 316 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
317 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 317 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
318 | ], | 318 | ], |
319 | ]; | 319 | ]; |
320 | 320 | ||
321 | $validator = Validator::make($request->all(), $rules, $messages); | 321 | $validator = Validator::make($request->all(), $rules, $messages); |
322 | 322 | ||
323 | 323 | ||
324 | if ($validator->fails()) { | 324 | if ($validator->fails()) { |
325 | return redirect()->route('index')->with('Error', "Email или пароль невалидный"); | 325 | return redirect()->route('index')->with('Error', "Email или пароль невалидный"); |
326 | } else { | 326 | } else { |
327 | $credentials = $request->only('email', 'password'); | 327 | $credentials = $request->only('email', 'password'); |
328 | 328 | ||
329 | if (Auth::attempt($credentials, $request->has('remember'))) { | 329 | if (Auth::attempt($credentials, $request->has('remember'))) { |
330 | 330 | ||
331 | if (is_null(Auth::user()->email_verified_at)) { | 331 | if (is_null(Auth::user()->email_verified_at)) { |
332 | Auth::logout(); | 332 | Auth::logout(); |
333 | return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); | 333 | return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); |
334 | } | 334 | } |
335 | 335 | ||
336 | if (Auth::user()->is_worker) { | 336 | if (Auth::user()->is_worker) { |
337 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); | 337 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); |
338 | } else { | 338 | } else { |
339 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); | 339 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); |
340 | } | 340 | } |
341 | 341 | ||
342 | return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); | 342 | return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); |
343 | //->route('index') | 343 | //->route('index') |
344 | //->with('success', 'Вы вошли в личный кабинет.'); | 344 | //->with('success', 'Вы вошли в личный кабинет.'); |
345 | } else { | 345 | } else { |
346 | return json_encode(Array("ERROR" => "Неверный логин или пароль!")); | 346 | return json_encode(Array("ERROR" => "Неверный логин или пароль!")); |
347 | } | 347 | } |
348 | } | 348 | } |
349 | } | 349 | } |
350 | 350 | ||
351 | // Восстановление пароля | 351 | // Восстановление пароля |
352 | public function repair_password(Request $request) { | 352 | public function repair_password(Request $request) { |
353 | $rules = [ | 353 | $rules = [ |
354 | 'email' => 'required|string|email', | 354 | 'email' => 'required|string|email', |
355 | ]; | 355 | ]; |
356 | 356 | ||
357 | $messages = [ | 357 | $messages = [ |
358 | 'required' => 'Укажите обязательное поле «:attribute»', | 358 | 'required' => 'Укажите обязательное поле «:attribute»', |
359 | 'email' => 'Введите корректный email', | 359 | 'email' => 'Введите корректный email', |
360 | 'min' => [ | 360 | 'min' => [ |
361 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 361 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
362 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 362 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
363 | ], | 363 | ], |
364 | 'max' => [ | 364 | 'max' => [ |
365 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 365 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
366 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 366 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
367 | ], | 367 | ], |
368 | ]; | 368 | ]; |
369 | 369 | ||
370 | $validator = Validator::make($request->all(), $rules, $messages); | 370 | $validator = Validator::make($request->all(), $rules, $messages); |
371 | 371 | ||
372 | if ($validator->fails()) { | 372 | if ($validator->fails()) { |
373 | return redirect()->back()->with('Error', "Email невалидный"); | 373 | return redirect()->back()->with('Error', "Email невалидный"); |
374 | } else { | 374 | } else { |
375 | $new_password = Tools::generator_id(10); | 375 | $new_password = Tools::generator_id(10); |
376 | $hash_password = Hash::make($new_password); | 376 | $hash_password = Hash::make($new_password); |
377 | $user = User::query()->where('email', $request->get('email'))->first(); | 377 | $user = User::query()->where('email', $request->get('email'))->first(); |
378 | $EditRec = User::find($user->id); | 378 | $EditRec = User::find($user->id); |
379 | $EditRec->password = $hash_password; | 379 | $EditRec->password = $hash_password; |
380 | $EditRec->save(); | 380 | $EditRec->save(); |
381 | 381 | ||
382 | foreach ([$request->get('email')] as $recipient) { | 382 | foreach ([$request->get('email')] as $recipient) { |
383 | Mail::to($recipient)->send(new MailRepair($new_password)); | 383 | Mail::to($recipient)->send(new MailRepair($new_password)); |
384 | } | 384 | } |
385 | return redirect()->route('index'); | 385 | return redirect()->route('index'); |
386 | 386 | ||
387 | } | 387 | } |
388 | 388 | ||
389 | } | 389 | } |
390 | 390 | ||
391 | // Вывод новостей | 391 | // Вывод новостей |
392 | public function news(Request $request) { | 392 | public function news(Request $request) { |
393 | $Query = News::query(); | 393 | $Query = News::query(); |
394 | if ($request->has('search')) { | 394 | if ($request->has('search')) { |
395 | $search = $request->get('search'); | 395 | $search = $request->get('search'); |
396 | $Query = $Query->where('title', 'LIKE', "%$search%")-> | 396 | $Query = $Query->where('title', 'LIKE', "%$search%")-> |
397 | orWhere('text', 'LIKE', "%$search%"); | 397 | orWhere('text', 'LIKE', "%$search%"); |
398 | } | 398 | } |
399 | 399 | ||
400 | if ($request->ajax()) { | 400 | if ($request->ajax()) { |
401 | if ($request->get('sort')) { | 401 | if ($request->get('sort')) { |
402 | $sort = $request->get('sort'); | 402 | $sort = $request->get('sort'); |
403 | switch ($sort) { | 403 | switch ($sort) { |
404 | case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; | 404 | case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; |
405 | case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; | 405 | case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; |
406 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; | 406 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; |
407 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; | 407 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; |
408 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 408 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
409 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 409 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
410 | } | 410 | } |
411 | } | 411 | } |
412 | } | 412 | } |
413 | $Query_count = $Query->count(); | 413 | $Query_count = $Query->count(); |
414 | $Query = $Query->paginate(6); | 414 | $Query = $Query->paginate(6); |
415 | 415 | ||
416 | if ($request->ajax()) { | 416 | if ($request->ajax()) { |
417 | return view('ajax.news-list', compact('Query', 'Query_count')); | 417 | return view('ajax.news-list', compact('Query', 'Query_count')); |
418 | } else { | 418 | } else { |
419 | return view('news-list', compact('Query', 'Query_count')); | 419 | return view('news-list', compact('Query', 'Query_count')); |
420 | } | 420 | } |
421 | } | 421 | } |
422 | 422 | ||
423 | //Детальная новость | 423 | //Детальная новость |
424 | public function detail_new(News $new) { | 424 | public function detail_new(News $new) { |
425 | // Наборка | 425 | // Наборка |
426 | $Query = News::query()->where('id', $new->id)->get(); | 426 | $Query = News::query()->where('id', $new->id)->get(); |
427 | $title = $Query[0]->title; | 427 | $title = $Query[0]->title; |
428 | $All_Query = News::query()->paginate(8); | 428 | $All_Query = News::query()->paginate(8); |
429 | return view('detail_new', compact('Query', 'All_Query', 'title')); | 429 | return view('detail_new', compact('Query', 'All_Query', 'title')); |
430 | } | 430 | } |
431 | } | 431 | } |
432 | 432 |
routes/web.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use App\Http\Controllers\Ad_jobsController; | 3 | use App\Http\Controllers\Ad_jobsController; |
4 | use App\Http\Controllers\AdEmployerController; | 4 | use App\Http\Controllers\AdEmployerController; |
5 | use App\Http\Controllers\Admin\AdminController; | 5 | use App\Http\Controllers\Admin\AdminController; |
6 | use App\Http\Controllers\Admin\CategoryController; | 6 | use App\Http\Controllers\Admin\CategoryController; |
7 | use App\Http\Controllers\Admin\CategoryEmpController; | 7 | use App\Http\Controllers\Admin\CategoryEmpController; |
8 | use App\Http\Controllers\Admin\EducationController; | 8 | use App\Http\Controllers\Admin\EducationController; |
9 | use App\Http\Controllers\Admin\EmployersController; | 9 | use App\Http\Controllers\Admin\EmployersController; |
10 | use App\Http\Controllers\EmployerController as FrontEmployersController; | 10 | use App\Http\Controllers\EmployerController as FrontEmployersController; |
11 | use App\Http\Controllers\Admin\InfoBloksController; | 11 | use App\Http\Controllers\Admin\InfoBloksController; |
12 | use App\Http\Controllers\Admin\JobTitlesController; | 12 | use App\Http\Controllers\Admin\JobTitlesController; |
13 | use App\Http\Controllers\Admin\UsersController; | 13 | use App\Http\Controllers\Admin\UsersController; |
14 | use App\Http\Controllers\Admin\WorkersController; | 14 | use App\Http\Controllers\Admin\WorkersController; |
15 | use App\Http\Controllers\Auth\ForgotPasswordController; | 15 | use App\Http\Controllers\Auth\ForgotPasswordController; |
16 | use App\Http\Controllers\Auth\LoginController; | 16 | use App\Http\Controllers\Auth\LoginController; |
17 | use App\Http\Controllers\Auth\RegisterController; | 17 | use App\Http\Controllers\Auth\RegisterController; |
18 | use App\Http\Controllers\CKEditorController; | 18 | use App\Http\Controllers\CKEditorController; |
19 | use App\Http\Controllers\MediaController; | 19 | use App\Http\Controllers\MediaController; |
20 | use App\Http\Controllers\WorkerController; | 20 | use App\Http\Controllers\WorkerController; |
21 | use App\Models\Ad_jobs; | 21 | use App\Models\Ad_jobs; |
22 | use App\Models\User; | 22 | use App\Models\User; |
23 | use App\Http\Controllers\MainController; | 23 | use App\Http\Controllers\MainController; |
24 | use App\Http\Controllers\HomeController; | 24 | use App\Http\Controllers\HomeController; |
25 | use Illuminate\Support\Facades\Route; | 25 | use Illuminate\Support\Facades\Route; |
26 | use App\Http\Controllers\Admin\CompanyController; | 26 | use App\Http\Controllers\Admin\CompanyController; |
27 | use App\Http\Controllers\Admin\Ad_EmployersController; | 27 | use App\Http\Controllers\Admin\Ad_EmployersController; |
28 | use App\Http\Controllers\Admin\MsgAnswersController; | 28 | use App\Http\Controllers\Admin\MsgAnswersController; |
29 | use App\Http\Controllers\Admin\GroupsController; | 29 | use App\Http\Controllers\Admin\GroupsController; |
30 | use App\Http\Controllers\PagesController; | 30 | use App\Http\Controllers\PagesController; |
31 | use Illuminate\Support\Facades\Storage; | 31 | use Illuminate\Support\Facades\Storage; |
32 | use App\Http\Controllers\EmployerController; | 32 | use App\Http\Controllers\EmployerController; |
33 | use App\Http\Controllers\CompanyController as FrontCompanyController; | 33 | use App\Http\Controllers\CompanyController as FrontCompanyController; |
34 | 34 | ||
35 | 35 | ||
36 | /* | 36 | /* |
37 | |-------------------------------------------------------------------------- | 37 | |-------------------------------------------------------------------------- |
38 | | Web Routes | 38 | | Web Routes |
39 | |-------------------------------------------------------------------------- | 39 | |-------------------------------------------------------------------------- |
40 | | | 40 | | |
41 | | Here is where you can register web routes for your application. These | 41 | | Here is where you can register web routes for your application. These |
42 | | routes are loaded by the RouteServiceProvider within a group which | 42 | | routes are loaded by the RouteServiceProvider within a group which |
43 | | contains the "web" middleware group. Now create something great! | 43 | | contains the "web" middleware group. Now create something great! |
44 | | | 44 | | |
45 | */ | 45 | */ |
46 | /* | 46 | /* |
47 | Route::get('/', function () { | 47 | Route::get('/', function () { |
48 | return view('welcome'); | 48 | return view('welcome'); |
49 | })->name('index'); | 49 | })->name('index'); |
50 | */ | 50 | */ |
51 | 51 | ||
52 | Route::get('/', [MainController::class, 'index'])->name('index'); | 52 | Route::get('/', [MainController::class, 'index'])->name('index'); |
53 | 53 | ||
54 | //Роуты авторизации, регистрации, восстановления, аутентификации | 54 | //Роуты авторизации, регистрации, восстановления, аутентификации |
55 | Auth::routes(['verify' => true]); | 55 | Auth::routes(['verify' => true]); |
56 | 56 | ||
57 | // роуты регистрации, авторизации, восстановления пароля, верификации почты | 57 | // роуты регистрации, авторизации, восстановления пароля, верификации почты |
58 | /*Route::group([ | 58 | /*Route::group([ |
59 | 'as' => 'auth.', //имя маршрута, например auth.index | 59 | 'as' => 'auth.', //имя маршрута, например auth.index |
60 | 'prefix' => 'auth', // префикс маршрута, например, auth/index | 60 | 'prefix' => 'auth', // префикс маршрута, например, auth/index |
61 | ], function () { | 61 | ], function () { |
62 | //форма регистрации | 62 | //форма регистрации |
63 | Route::get('register', [RegisterController::class, 'register'])->name('register'); | 63 | Route::get('register', [RegisterController::class, 'register'])->name('register'); |
64 | 64 | ||
65 | //создание пользователя | 65 | //создание пользователя |
66 | Route::post('register', [RegisterController::class, 'create'])->name('create'); | 66 | Route::post('register', [RegisterController::class, 'create'])->name('create'); |
67 | 67 | ||
68 | //форма входа авторизации | 68 | //форма входа авторизации |
69 | Route::get('login', [LoginController::class, 'login'])->name('login'); | 69 | Route::get('login', [LoginController::class, 'login'])->name('login'); |
70 | 70 | ||
71 | //аутентификация | 71 | //аутентификация |
72 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); | 72 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); |
73 | 73 | ||
74 | //выход | 74 | //выход |
75 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); | 75 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); |
76 | 76 | ||
77 | //форма ввода адреса почты | 77 | //форма ввода адреса почты |
78 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); | 78 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); |
79 | 79 | ||
80 | //письмо на почту | 80 | //письмо на почту |
81 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); | 81 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); |
82 | 82 | ||
83 | //форма восстановления пароля | 83 | //форма восстановления пароля |
84 | Route::get('reset-password/token/{token}/email/{email}', | 84 | Route::get('reset-password/token/{token}/email/{email}', |
85 | [ResetPasswordController::class, 'form'] | 85 | [ResetPasswordController::class, 'form'] |
86 | )->name('reset-form'); | 86 | )->name('reset-form'); |
87 | 87 | ||
88 | //восстановление пароля | 88 | //восстановление пароля |
89 | Route::post('reset-password', | 89 | Route::post('reset-password', |
90 | [ResetPasswordController::class, 'reset'] | 90 | [ResetPasswordController::class, 'reset'] |
91 | )->name('reset-password'); | 91 | )->name('reset-password'); |
92 | 92 | ||
93 | //сообщение о необходимости проверки адреса почты | 93 | //сообщение о необходимости проверки адреса почты |
94 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); | 94 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); |
95 | 95 | ||
96 | //подтверждение адреса почты нового пользователя | 96 | //подтверждение адреса почты нового пользователя |
97 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) | 97 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) |
98 | ->where('token', '[a-f0-9]{32}') | 98 | ->where('token', '[a-f0-9]{32}') |
99 | ->where('id', '[0-9]+') | 99 | ->where('id', '[0-9]+') |
100 | ->name('verify-email'); | 100 | ->name('verify-email'); |
101 | });*/ | 101 | });*/ |
102 | 102 | ||
103 | //Личный кабинет пользователя | 103 | //Личный кабинет пользователя |
104 | Route::get('/home', [HomeController::class, 'index'])->name('home'); | 104 | Route::get('/home', [HomeController::class, 'index'])->name('home'); |
105 | 105 | ||
106 | /* | 106 | /* |
107 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { | 107 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { |
108 | $user = User::where('email',$request->input('email'))->first(); | 108 | $user = User::where('email',$request->input('email'))->first(); |
109 | 109 | ||
110 | $user->sendEmailVerificationNotification(); | 110 | $user->sendEmailVerificationNotification(); |
111 | 111 | ||
112 | return 'your response'; | 112 | return 'your response'; |
113 | })->middleware('throttle:6,1')->name('verification.resend'); | 113 | })->middleware('throttle:6,1')->name('verification.resend'); |
114 | */ | 114 | */ |
115 | 115 | ||
116 | // Авторизация, регистрация в админку | 116 | // Авторизация, регистрация в админку |
117 | Route::group([ | 117 | Route::group([ |
118 | 'as' => 'admin.', // имя маршрута, например auth.index | 118 | 'as' => 'admin.', // имя маршрута, например auth.index |
119 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 119 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
120 | 'middleware' => ['guest'], | 120 | 'middleware' => ['guest'], |
121 | ], function () { | 121 | ], function () { |
122 | // Форма регистрации | 122 | // Форма регистрации |
123 | Route::get('register', [AdminController::class, 'register'])->name('register'); | 123 | Route::get('register', [AdminController::class, 'register'])->name('register'); |
124 | // Создание пользователя | 124 | // Создание пользователя |
125 | Route::post('register', [AdminController::class, 'create'])->name('create'); | 125 | Route::post('register', [AdminController::class, 'create'])->name('create'); |
126 | 126 | ||
127 | //Форма входа | 127 | //Форма входа |
128 | Route::get('login', [AdminController::class, 'login'])->name('login'); | 128 | Route::get('login', [AdminController::class, 'login'])->name('login'); |
129 | 129 | ||
130 | // аутентификация | 130 | // аутентификация |
131 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); | 131 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); |
132 | 132 | ||
133 | }); | 133 | }); |
134 | 134 | ||
135 | // Личный кабинет админки | 135 | // Личный кабинет админки |
136 | Route::group([ | 136 | Route::group([ |
137 | 'as' => 'admin.', // имя маршрута, например auth.index | 137 | 'as' => 'admin.', // имя маршрута, например auth.index |
138 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 138 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
139 | 'middleware' => ['auth'], ['admin'], | 139 | 'middleware' => ['auth'], ['admin'], |
140 | ], function() { | 140 | ], function() { |
141 | 141 | ||
142 | // выход | 142 | // выход |
143 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); | 143 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); |
144 | 144 | ||
145 | // кабинет главная страница | 145 | // кабинет главная страница |
146 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); | 146 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); |
147 | 147 | ||
148 | // кабинет профиль админа - форма | 148 | // кабинет профиль админа - форма |
149 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); | 149 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); |
150 | // кабинет профиль админа - сохранение формы | 150 | // кабинет профиль админа - сохранение формы |
151 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); | 151 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); |
152 | 152 | ||
153 | //кабинет сообщения админа | 153 | //кабинет сообщения админа |
154 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); | 154 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); |
155 | 155 | ||
156 | 156 | ||
157 | // кабинет профиль - форма пароли | 157 | // кабинет профиль - форма пароли |
158 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); | 158 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); |
159 | // кабинет профиль - сохранение формы пароля | 159 | // кабинет профиль - сохранение формы пароля |
160 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); | 160 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); |
161 | 161 | ||
162 | 162 | ||
163 | // кабинет профиль пользователя - форма | 163 | // кабинет профиль пользователя - форма |
164 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); | 164 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); |
165 | // кабинет профиль пользователя - сохранение формы | 165 | // кабинет профиль пользователя - сохранение формы |
166 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); | 166 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); |
167 | 167 | ||
168 | // кабинет профиль работодатель - форма | 168 | // кабинет профиль работодатель - форма |
169 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); | 169 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); |
170 | // кабинет профиль работодатель - сохранение формы | 170 | // кабинет профиль работодатель - сохранение формы |
171 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); | 171 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); |
172 | // кабинет удаление профиль работодателя и юзера | 172 | // кабинет удаление профиль работодателя и юзера |
173 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); | 173 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); |
174 | 174 | ||
175 | // кабинет профиль работник - форма | 175 | // кабинет профиль работник - форма |
176 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); | 176 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); |
177 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); | 177 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); |
178 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); | 178 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); |
179 | // кабинет профиль работник - сохранение формы | 179 | // кабинет профиль работник - сохранение формы |
180 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); | 180 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); |
181 | 181 | ||
182 | // Медиа | 182 | // Медиа |
183 | Route::get('media', [MediaController::class, 'index'])->name('media'); | 183 | Route::get('media', [MediaController::class, 'index'])->name('media'); |
184 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); | 184 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); |
185 | 185 | ||
186 | // кабинет настройки сайта - форма | 186 | // кабинет настройки сайта - форма |
187 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); | 187 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); |
188 | // кабинет настройки сайта сохранение формы | 188 | // кабинет настройки сайта сохранение формы |
189 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); | 189 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); |
190 | 190 | ||
191 | // кабинет - пользователи | 191 | // кабинет - пользователи |
192 | Route::get('users', [UsersController::class, 'index'])->name('users'); | 192 | Route::get('users', [UsersController::class, 'index'])->name('users'); |
193 | 193 | ||
194 | // кабинет - пользователи | 194 | // кабинет - пользователи |
195 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); | 195 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); |
196 | 196 | ||
197 | // кабинет - работодатели | 197 | // кабинет - работодатели |
198 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); | 198 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); |
199 | 199 | ||
200 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); | 200 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); |
201 | 201 | ||
202 | Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); | 202 | Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); |
203 | Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); | 203 | Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); |
204 | Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); | 204 | Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); |
205 | Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); | 205 | Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); |
206 | Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); | 206 | Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); |
207 | 207 | ||
208 | // кабинет - соискатели | 208 | // кабинет - соискатели |
209 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); | 209 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); |
210 | 210 | ||
211 | // кабинет - база данных | 211 | // кабинет - база данных |
212 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); | 212 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); |
213 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); | 213 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); |
214 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); | 214 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); |
215 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); | 215 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); |
216 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); | 216 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); |
217 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); | 217 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); |
218 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); | 218 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); |
219 | 219 | ||
220 | // кабинет - вакансии | 220 | // кабинет - вакансии |
221 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); | 221 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); |
222 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); | 222 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); |
223 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); | 223 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); |
224 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); | 224 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); |
225 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); | 225 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); |
226 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); | 226 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); |
227 | 227 | ||
228 | // Редактирование должности в вакансии | 228 | // Редактирование должности в вакансии |
229 | Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); | 229 | Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); |
230 | Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); | 230 | Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); |
231 | 231 | ||
232 | 232 | ||
233 | // кабинет - категории | 233 | // кабинет - категории |
234 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); | 234 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); |
235 | /* | 235 | |
236 | * CRUD-операции над Справочником Категории | 236 | // СRUD-операции над Справочником Категории |
237 | */ | 237 | |
238 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); | 238 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); |
239 | 239 | ||
240 | // CRUD-операции над справочником Категории для работодателей | 240 | // CRUD-операции над справочником Категории для работодателей |
241 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); | 241 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); |
242 | 242 | ||
243 | // CRUD-операции над справочником Образование | 243 | // CRUD-операции над справочником Образование |
244 | Route::resource('education', EducationController::class, ['except' => ['show']]); | 244 | Route::resource('education', EducationController::class, ['except' => ['show']]); |
245 | 245 | ||
246 | Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); | 246 | Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); |
247 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); | 247 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); |
248 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); | 248 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); |
249 | 249 | ||
250 | Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); | 250 | Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); |
251 | Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); | 251 | Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); |
252 | 252 | ||
253 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); | 253 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); |
254 | 254 | ||
255 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); | 255 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); |
256 | /* | 256 | /* |
257 | * кабинет - CRUD-операции по справочнику должности | 257 | * кабинет - CRUD-операции по справочнику должности |
258 | * | 258 | * |
259 | */ | 259 | */ |
260 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); | 260 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); |
261 | 261 | ||
262 | // кабинет - сообщения (чтение чужих) | 262 | // кабинет - сообщения (чтение чужих) |
263 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); | 263 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); |
264 | // кабинет - просмотр сообщения чужого (чтение) | 264 | // кабинет - просмотр сообщения чужого (чтение) |
265 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); | 265 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); |
266 | 266 | ||
267 | // кабинет - сообщения (админские) | 267 | // кабинет - сообщения (админские) |
268 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); | 268 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); |
269 | // кабинет - сообщения (админские) | 269 | // кабинет - сообщения (админские) |
270 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); | 270 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); |
271 | // кабинет - sql - конструкция запросов | 271 | // кабинет - sql - конструкция запросов |
272 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); | 272 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); |
273 | 273 | ||
274 | /* | 274 | /* |
275 | * Расписанный подход в описании каждой директорий групп пользователей. | 275 | * Расписанный подход в описании каждой директорий групп пользователей. |
276 | */ | 276 | */ |
277 | // кабинет - группы пользователей | 277 | // кабинет - группы пользователей |
278 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); | 278 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); |
279 | // кабинет - добавление форма группы пользователей | 279 | // кабинет - добавление форма группы пользователей |
280 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); | 280 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); |
281 | // кабинет - сохранение формы группы пользователей | 281 | // кабинет - сохранение формы группы пользователей |
282 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); | 282 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); |
283 | // кабинет - редактирование форма группы пользователей | 283 | // кабинет - редактирование форма группы пользователей |
284 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); | 284 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); |
285 | // кабинет - сохранение редактированной формы группы пользователей | 285 | // кабинет - сохранение редактированной формы группы пользователей |
286 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); | 286 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); |
287 | // кабинет - удаление группы пользователей | 287 | // кабинет - удаление группы пользователей |
288 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); | 288 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); |
289 | 289 | ||
290 | 290 | ||
291 | // кабинет - список админов | 291 | // кабинет - список админов |
292 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); | 292 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); |
293 | 293 | ||
294 | // справочник Позиции | 294 | // справочник Позиции |
295 | Route::get('positions', [AdminController::class, 'position'])->name('position'); | 295 | Route::get('positions', [AdminController::class, 'position'])->name('position'); |
296 | Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); | 296 | Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); |
297 | Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); | 297 | Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); |
298 | Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); | 298 | Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); |
299 | Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); | 299 | Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); |
300 | Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); | 300 | Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); |
301 | 301 | ||
302 | /////редактор////// кабинет - редактор сайта//////////////////////// | 302 | /////редактор////// кабинет - редактор сайта//////////////////////// |
303 | Route::get('editor-site', function() { | 303 | Route::get('editor-site', function() { |
304 | return view('admin.editor.index'); | 304 | return view('admin.editor.index'); |
305 | })->name('editor-site'); | 305 | })->name('editor-site'); |
306 | 306 | ||
307 | 307 | ||
308 | // кабинет - редактор шапки-футера сайта | 308 | // кабинет - редактор шапки-футера сайта |
309 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); | 309 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); |
310 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); | 310 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); |
311 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); | 311 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); |
312 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); | 312 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); |
313 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); | 313 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); |
314 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); | 314 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); |
315 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); | 315 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); |
316 | 316 | ||
317 | 317 | ||
318 | // кабинет - редактор должности на главной | 318 | // кабинет - редактор должности на главной |
319 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); | 319 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); |
320 | 320 | ||
321 | // кабинет - редактор работодатели на главной | 321 | // кабинет - редактор работодатели на главной |
322 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); | 322 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); |
323 | 323 | ||
324 | 324 | ||
325 | // кабинет - редактор seo-сайта | 325 | // кабинет - редактор seo-сайта |
326 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); | 326 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); |
327 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); | 327 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); |
328 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); | 328 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); |
329 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); | 329 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); |
330 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); | 330 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); |
331 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); | 331 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); |
332 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); | 332 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); |
333 | 333 | ||
334 | 334 | ||
335 | // кабинет - редактор страниц | 335 | // кабинет - редактор страниц |
336 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); | 336 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); |
337 | // кабинет - добавление страницы | 337 | // кабинет - добавление страницы |
338 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); | 338 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); |
339 | // кабинет - сохранение формы страницы | 339 | // кабинет - сохранение формы страницы |
340 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); | 340 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); |
341 | // кабинет - редактирование форма страницы | 341 | // кабинет - редактирование форма страницы |
342 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); | 342 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); |
343 | // кабинет - сохранение редактированной формы страницы | 343 | // кабинет - сохранение редактированной формы страницы |
344 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); | 344 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); |
345 | // кабинет - удаление страницы | 345 | // кабинет - удаление страницы |
346 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); | 346 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); |
347 | 347 | ||
348 | 348 | ||
349 | // кабинет - реклама сайта | 349 | // кабинет - реклама сайта |
350 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); | 350 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); |
351 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); | 351 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); |
352 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); | 352 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); |
353 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); | 353 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); |
354 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); | 354 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); |
355 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); | 355 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); |
356 | //////////////////////////////////////////////////////////////////////// | 356 | //////////////////////////////////////////////////////////////////////// |
357 | 357 | ||
358 | 358 | ||
359 | // кабинет - отзывы о работодателе для модерации | 359 | // кабинет - отзывы о работодателе для модерации |
360 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); | 360 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); |
361 | 361 | ||
362 | // Общая страница статистики | 362 | // Общая страница статистики |
363 | Route::get('statics', function () { | 363 | Route::get('statics', function () { |
364 | return view('admin.static.index'); | 364 | return view('admin.static.index'); |
365 | })->name('statics'); | 365 | })->name('statics'); |
366 | 366 | ||
367 | // кабинет - статистика работников | 367 | // кабинет - статистика работников |
368 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); | 368 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); |
369 | 369 | ||
370 | // кабинет - статистика вакансий работодателя | 370 | // кабинет - статистика вакансий работодателя |
371 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); | 371 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); |
372 | 372 | ||
373 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника | 373 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника |
374 | /* | 374 | /* |
375 | * CRUD-операции над справочником дипломы и документы | 375 | * CRUD-операции над справочником дипломы и документы |
376 | */ | 376 | */ |
377 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); | 377 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); |
378 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); | 378 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); |
379 | 379 | ||
380 | // кабинет - роли пользователя | 380 | // кабинет - роли пользователя |
381 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); | 381 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); |
382 | 382 | ||
383 | Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); | 383 | Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); |
384 | 384 | ||
385 | Route::get('logs', function() { | 385 | Route::get('logs', function() { |
386 | $files = Storage::files('logs/laravel.log'); | 386 | $files = Storage::files('logs/laravel.log'); |
387 | })->name('logs'); | 387 | })->name('logs'); |
388 | }); | 388 | }); |
389 | 389 | ||
390 | // Инструментальные страницы | 390 | // Инструментальные страницы |
391 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); | 391 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); |
392 | 392 | ||
393 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); | 393 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); |
394 | 394 | ||
395 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); | 395 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); |
396 | 396 | ||
397 | // Страницы с произвольным контентом | 397 | // Страницы с произвольным контентом |
398 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); | 398 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); |
399 | 399 | ||
400 | // Публичные страницы соискателя | 400 | // Публичные страницы соискателя |
401 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); | 401 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); |
402 | 402 | ||
403 | //Страница вакансии | 403 | //Страница вакансии |
404 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); | 404 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); |
405 | 405 | ||
406 | //Вакансии | 406 | //Вакансии |
407 | Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); | 407 | Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); |
408 | 408 | ||
409 | //Вакансии поиск на главной | 409 | //Вакансии поиск на главной |
410 | Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); | 410 | Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); |
411 | 411 | ||
412 | //Вакансии категория детальная | 412 | //Вакансии категория детальная |
413 | Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); | 413 | Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); |
414 | 414 | ||
415 | // Лайк вакансии | 415 | // Лайк вакансии |
416 | Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); | 416 | Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); |
417 | 417 | ||
418 | //Детальная страница вакансии - работодателя | 418 | //Детальная страница вакансии - работодателя |
419 | Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); | 419 | Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); |
420 | 420 | ||
421 | //Судоходные компании | 421 | //Судоходные компании |
422 | Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); | 422 | Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); |
423 | 423 | ||
424 | //Детальная инфа о компании | 424 | //Детальная инфа о компании |
425 | Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); | 425 | Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); |
426 | 426 | ||
427 | //Образование | 427 | //Образование |
428 | Route::get('education', [MainController::class, 'education'])->name('education'); | 428 | Route::get('education', [MainController::class, 'education'])->name('education'); |
429 | 429 | ||
430 | //Новости | 430 | //Новости |
431 | Route::get('news', [MainController::class, 'news'])->name('news'); | 431 | Route::get('news', [MainController::class, 'news'])->name('news'); |
432 | Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); | 432 | Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); |
433 | 433 | ||
434 | //Контакты | 434 | //Контакты |
435 | Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); | 435 | Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); |
436 | 436 | ||
437 | //База резюме | 437 | //База резюме |
438 | Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); | 438 | Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); |
439 | 439 | ||
440 | Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); | 440 | Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); |
441 | 441 | ||
442 | //Анкета соискателя | 442 | //Анкета соискателя |
443 | Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); | 443 | Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); |
444 | 444 | ||
445 | //Скачать резюме | 445 | //Скачать резюме |
446 | Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); | 446 | Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); |
447 | 447 | ||
448 | //Вход в кабинет | 448 | //Вход в кабинет |
449 | Route::get('login', [MainController::class, 'input_login'])->name('login'); | 449 | Route::get('login', [MainController::class, 'input_login'])->name('login'); |
450 | 450 | ||
451 | // Выход из кабинета | 451 | // Выход из кабинета |
452 | Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); | 452 | Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); |
453 | 453 | ||
454 | Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); | 454 | Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); |
455 | Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); | 455 | Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); |
456 | 456 | ||
457 | //восстановление пароля | 457 | //восстановление пароля |
458 | Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); | 458 | Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); |
459 | // Звезда сообщения | 459 | // Звезда сообщения |
460 | Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); | 460 | Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); |
461 | 461 | ||
462 | // Борьба | 462 | // Борьба |
463 | Route::get('clear_cookie', function() { | 463 | Route::get('clear_cookie', function() { |
464 | \App\Classes\Cookies_vacancy::clear_vacancy(); | 464 | \App\Classes\Cookies_vacancy::clear_vacancy(); |
465 | return redirect()->route('index'); | 465 | return redirect()->route('index'); |
466 | })->name('clear_cookie'); | 466 | })->name('clear_cookie'); |
467 | 467 | ||
468 | Route::get('cookies', function() { | 468 | Route::get('cookies', function() { |
469 | return view('cookies'); | 469 | return view('cookies'); |
470 | })->name('cookies'); | 470 | })->name('cookies'); |
471 | 471 | ||
472 | 472 | ||
473 | 473 | ||
474 | 474 | ||
475 | // Личный кабинет работник | 475 | // Личный кабинет работник |
476 | Route::group([ | 476 | Route::group([ |
477 | 'as' => 'worker.', // имя маршрута, например auth.index | 477 | 'as' => 'worker.', // имя маршрута, например auth.index |
478 | 'prefix' => 'worker', // префикс маршрута, например auth/index | 478 | 'prefix' => 'worker', // префикс маршрута, например auth/index |
479 | 'middleware' => ['auth'], ['is_worker'], | 479 | 'middleware' => ['auth'], ['is_worker'], |
480 | ], function() { | 480 | ], function() { |
481 | // 1 страница - Моя анкета | 481 | // 1 страница - Моя анкета |
482 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); | 482 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); |
483 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); | 483 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); |
484 | 484 | ||
485 | // 2 страница - Сообщения | 485 | // 2 страница - Сообщения |
486 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); | 486 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); |
487 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); | 487 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); |
488 | // 3 страница - Избранные вакансии | 488 | // 3 страница - Избранные вакансии |
489 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); | 489 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); |
490 | // Продолжение борьбы против колорадов - избранные вакансии | 490 | // Продолжение борьбы против колорадов - избранные вакансии |
491 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); | 491 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); |
492 | 492 | ||
493 | // 4 страница - Сменить пароль | 493 | // 4 страница - Сменить пароль |
494 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); | 494 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); |
495 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); | 495 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); |
496 | 496 | ||
497 | // 5 страница - Удалить профиль | 497 | // 5 страница - Удалить профиль |
498 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); | 498 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); |
499 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); | 499 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); |
500 | 500 | ||
501 | // Резюме -pdf | 501 | // Резюме -pdf |
502 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); | 502 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); |
503 | 503 | ||
504 | // Поднятие анкеты | 504 | // Поднятие анкеты |
505 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); | 505 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); |
506 | 506 | ||
507 | // Добавление сертификата | 507 | // Добавление сертификата |
508 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); | 508 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); |
509 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); | 509 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); |
510 | 510 | ||
511 | // Добавление документа-диплома | 511 | // Добавление документа-диплома |
512 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); | 512 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); |
513 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); | 513 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); |
514 | 514 | ||
515 | // Добавление стандартного диплома | 515 | // Добавление стандартного диплома |
516 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); | 516 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); |
517 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); | 517 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); |
518 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); | 518 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); |
519 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); | 519 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); |
520 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); | 520 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); |
521 | 521 | ||
522 | // Отправка сообщения работодателю от соискателя | 522 | // Отправка сообщения работодателю от соискателя |
523 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); | 523 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); |
524 | }); | 524 | }); |
525 | 525 | ||
526 | // Личный кабинет работодателя | 526 | // Личный кабинет работодателя |
527 | Route::group([ | 527 | Route::group([ |
528 | 'as' => 'employer.', // имя маршрута, например auth.index | 528 | 'as' => 'employer.', // имя маршрута, например auth.index |
529 | 'prefix' => 'employer', // префикс маршрута, например auth/index | 529 | 'prefix' => 'employer', // префикс маршрута, например auth/index |
530 | 'middleware' => ['auth'], !['is_worker'], | 530 | 'middleware' => ['auth'], !['is_worker'], |
531 | ], function() { | 531 | ], function() { |
532 | // 1 страница - Профиль | 532 | // 1 страница - Профиль |
533 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); | 533 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); |
534 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); | 534 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); |
535 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); | 535 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); |
536 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); | 536 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); |
537 | 537 | ||
538 | // 2 страница - Добавление вакансий | 538 | // 2 страница - Добавление вакансий |
539 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); | 539 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); |
540 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); | 540 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); |
541 | 541 | ||
542 | 542 | ||
543 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); | 543 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); |
544 | 544 | ||
545 | 545 | ||
546 | // 3 страница - Мои вакансии | 546 | // 3 страница - Мои вакансии |
547 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); | 547 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); |
548 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 548 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
549 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); | 549 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); |
550 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); | 550 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); |
551 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); | 551 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); |
552 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 552 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
553 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); | 553 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); |
554 | 554 | ||
555 | // 4.1Ю. | 555 | // 4.1Ю. |
556 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); | 556 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); |
557 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); | 557 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); |
558 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); | 558 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); |
559 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); | 559 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); |
560 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); | 560 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); |
561 | 561 | ||
562 | // 4 страница - Отклики на вакансии | 562 | // 4 страница - Отклики на вакансии |
563 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); | 563 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); |
564 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); | 564 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); |
565 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); | 565 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); |
566 | 566 | ||
567 | // 5 страница - Сообщения | 567 | // 5 страница - Сообщения |
568 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); | 568 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); |
569 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); | 569 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); |
570 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); | 570 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); |
571 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); | 571 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); |
572 | 572 | ||
573 | // 6 страница - Избранный | 573 | // 6 страница - Избранный |
574 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); | 574 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); |
575 | 575 | ||
576 | //7 страница - База данных | 576 | //7 страница - База данных |
577 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); | 577 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); |
578 | 578 | ||
579 | //8 страница - База резюме | 579 | //8 страница - База резюме |
580 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); | 580 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); |
581 | 581 | ||
582 | // 9 рассылка сообщений | 582 | // 9 рассылка сообщений |
583 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); | 583 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); |
584 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); | 584 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); |
585 | 585 | ||
586 | // 10 страница FAQ вопросы | 586 | // 10 страница FAQ вопросы |
587 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); | 587 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); |
588 | 588 | ||
589 | // 11 страница - Настройка уведомлений | 589 | // 11 страница - Настройка уведомлений |
590 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); | 590 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); |
591 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); | 591 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); |
592 | 592 | ||
593 | // 12 страница - Сменить пароль | 593 | // 12 страница - Сменить пароль |
594 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); | 594 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); |
595 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); | 595 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); |
596 | 596 | ||
597 | // 13 страница - Удаление профиля | 597 | // 13 страница - Удаление профиля |
598 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); | 598 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); |
599 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); | 599 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); |
600 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); | 600 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); |
601 | 601 | ||
602 | // Отправил сообщение | 602 | // Отправил сообщение |
603 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); | 603 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); |
604 | }); | 604 | }); |
605 | 605 | ||
606 | 606 | ||
607 | 607 |