Commit 71c4916ec2be11dedfb63c938c85be3aa95bedcc
1 parent
3bb5fff09a
Exists in
usloviya-razmeschniya
условия размещения - изменили email администратора
Showing 1 changed file with 1 additions and 0 deletions Inline Diff
app/Http/Controllers/PagesController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Http\Requests\RequestSendAdmin; | 5 | use App\Http\Requests\RequestSendAdmin; |
6 | use App\Mail\MailAdminy; | 6 | use App\Mail\MailAdminy; |
7 | use App\Mail\MailRepair; | 7 | use App\Mail\MailRepair; |
8 | use App\Models\pages; | 8 | use App\Models\pages; |
9 | use Illuminate\Http\Request; | 9 | use Illuminate\Http\Request; |
10 | use Illuminate\Support\Facades\Mail; | 10 | use Illuminate\Support\Facades\Mail; |
11 | use Illuminate\Support\Facades\Redis; | 11 | use Illuminate\Support\Facades\Redis; |
12 | use PhpOffice\PhpSpreadsheet\Spreadsheet; | 12 | use PhpOffice\PhpSpreadsheet\Spreadsheet; |
13 | use PhpOffice\PhpSpreadsheet\Writer\Xlsx; | 13 | use PhpOffice\PhpSpreadsheet\Writer\Xlsx; |
14 | 14 | ||
15 | class PagesController extends Controller | 15 | class PagesController extends Controller |
16 | { | 16 | { |
17 | public function pages(pages $pages) { | 17 | public function pages(pages $pages) { |
18 | $page = pages::query()->where('slug', $pages->slug)->first(); | 18 | $page = pages::query()->where('slug', $pages->slug)->first(); |
19 | $slug = $pages->slug; | 19 | $slug = $pages->slug; |
20 | 20 | ||
21 | return view('pages', compact('page', 'slug')); | 21 | return view('pages', compact('page', 'slug')); |
22 | } | 22 | } |
23 | 23 | ||
24 | public function form_feedback(RequestSendAdmin $request){ | 24 | public function form_feedback(RequestSendAdmin $request){ |
25 | $all = $request->all(); | 25 | $all = $request->all(); |
26 | |||
26 | Mail::to(config('mail.emailAdmin'))->send(new MailAdminy($all)); | 27 | Mail::to(config('mail.emailAdmin'))->send(new MailAdminy($all)); |
27 | 28 | ||
28 | return redirect()->back()->with('Сообщение было успешно отправлено и будет обработано'); | 29 | return redirect()->back()->with('Сообщение было успешно отправлено и будет обработано'); |
29 | } | 30 | } |
30 | 31 | ||
31 | public function redis() { | 32 | public function redis() { |
32 | $redis = Redis::connection(); | 33 | $redis = Redis::connection(); |
33 | $redis->set('User:CompanyName', 'РЕКАМОРЕ'); | 34 | $redis->set('User:CompanyName', 'РЕКАМОРЕ'); |
34 | $id = 1; | 35 | $id = 1; |
35 | //dd(Redis::get('MyVar')); | 36 | //dd(Redis::get('MyVar')); |
36 | $redis->command('rpush', array("Сообщение1")); | 37 | $redis->command('rpush', array("Сообщение1")); |
37 | $redis->command('rpush', array("Сообщение2")); | 38 | $redis->command('rpush', array("Сообщение2")); |
38 | $values = $redis->command('lrange', array("mylist", 0, 1)); | 39 | $values = $redis->command('lrange', array("mylist", 0, 1)); |
39 | dd($values); | 40 | dd($values); |
40 | 41 | ||
41 | } | 42 | } |
42 | 43 | ||
43 | public function excel() { | 44 | public function excel() { |
44 | $spreadsheet = new Spreadsheet(); | 45 | $spreadsheet = new Spreadsheet(); |
45 | $activeWorksheet = $spreadsheet->getActiveSheet(); | 46 | $activeWorksheet = $spreadsheet->getActiveSheet(); |
46 | $activeWorksheet->setCellValue('A1', 'Hello World !'); | 47 | $activeWorksheet->setCellValue('A1', 'Hello World !'); |
47 | 48 | ||
48 | $writer = new Xlsx($spreadsheet); | 49 | $writer = new Xlsx($spreadsheet); |
49 | $writer->save('hello_world.xlsx'); | 50 | $writer->save('hello_world.xlsx'); |
50 | } | 51 | } |
51 | 52 | ||
52 | public function private_policy() { | 53 | public function private_policy() { |
53 | return view('private_policy'); | 54 | return view('private_policy'); |
54 | } | 55 | } |
55 | 56 | ||
56 | public function terms_of_use() { | 57 | public function terms_of_use() { |
57 | return view('terms_of_use'); | 58 | return view('terms_of_use'); |
58 | } | 59 | } |
59 | } | 60 | } |
60 | 61 |