Commit 54d9782d4b4c92487b770f1302a89873520947aa
1 parent
d05174286d
Exists in
usloviya-razmeschniya
условия размещения - изменили email администратора
Showing 1 changed file with 0 additions and 1 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 | // Mail::to(env('EMAIL_ADMIN'))->send(new MailAdminy($all)); | ||
27 | Mail::to(config('mail.emailAdmin'))->send(new MailAdminy($all)); | 26 | Mail::to(config('mail.emailAdmin'))->send(new MailAdminy($all)); |
28 | 27 | ||
29 | return redirect()->back()->with('Сообщение было успешно отправлено и будет обработано'); | 28 | return redirect()->back()->with('Сообщение было успешно отправлено и будет обработано'); |
30 | } | 29 | } |
31 | 30 | ||
32 | public function redis() { | 31 | public function redis() { |
33 | $redis = Redis::connection(); | 32 | $redis = Redis::connection(); |
34 | $redis->set('User:CompanyName', 'РЕКАМОРЕ'); | 33 | $redis->set('User:CompanyName', 'РЕКАМОРЕ'); |
35 | $id = 1; | 34 | $id = 1; |
36 | //dd(Redis::get('MyVar')); | 35 | //dd(Redis::get('MyVar')); |
37 | $redis->command('rpush', array("Сообщение1")); | 36 | $redis->command('rpush', array("Сообщение1")); |
38 | $redis->command('rpush', array("Сообщение2")); | 37 | $redis->command('rpush', array("Сообщение2")); |
39 | $values = $redis->command('lrange', array("mylist", 0, 1)); | 38 | $values = $redis->command('lrange', array("mylist", 0, 1)); |
40 | dd($values); | 39 | dd($values); |
41 | 40 | ||
42 | } | 41 | } |
43 | 42 | ||
44 | public function excel() { | 43 | public function excel() { |
45 | $spreadsheet = new Spreadsheet(); | 44 | $spreadsheet = new Spreadsheet(); |
46 | $activeWorksheet = $spreadsheet->getActiveSheet(); | 45 | $activeWorksheet = $spreadsheet->getActiveSheet(); |
47 | $activeWorksheet->setCellValue('A1', 'Hello World !'); | 46 | $activeWorksheet->setCellValue('A1', 'Hello World !'); |
48 | 47 | ||
49 | $writer = new Xlsx($spreadsheet); | 48 | $writer = new Xlsx($spreadsheet); |
50 | $writer->save('hello_world.xlsx'); | 49 | $writer->save('hello_world.xlsx'); |
51 | } | 50 | } |
52 | 51 | ||
53 | public function private_policy() { | 52 | public function private_policy() { |
54 | return view('private_policy'); | 53 | return view('private_policy'); |
55 | } | 54 | } |
56 | 55 | ||
57 | public function terms_of_use() { | 56 | public function terms_of_use() { |
58 | return view('terms_of_use'); | 57 | return view('terms_of_use'); |
59 | } | 58 | } |
60 | } | 59 | } |
61 | 60 |