diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index dfcd177..9bb19a4 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -736,7 +736,12 @@ class EmployerController extends Controller // Рассылка сообщений public function send_all_messages() { - return view('employers.send_all'); + $id = Auth()->user()->id; + $sending = Employer::query()->where('id', '=', "$id")->first(); + if ($sending->sending_is) + return view('employers.send_all'); + else + return view('employers.send_all_danger'); } // Отправка сообщений для информации diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index e2df9e6..f9b6ecf 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -2,8 +2,12 @@ namespace App\Http\Controllers; +use App\Http\Requests\RequestSendAdmin; +use App\Mail\MailAdminy; +use App\Mail\MailRepair; use App\Models\pages; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Redis; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; @@ -16,6 +20,16 @@ class PagesController extends Controller return view('pages', compact('page')); } + public function form_feedback(RequestSendAdmin $request){ + $all = $request->all(); + + foreach ([$request->get('email')] as $recipient) { + Mail::to($recipient)->send(new MailAdminy($all)); + } + + return redirect()->back()->with('Сообщение было успешно отправлено и будет обработано'); + } + public function redis() { $redis = Redis::connection(); $redis->set('User:CompanyName', 'РЕКАМОРЕ'); diff --git a/app/Http/Requests/RequestSendAdmin.php b/app/Http/Requests/RequestSendAdmin.php new file mode 100644 index 0000000..a113586 --- /dev/null +++ b/app/Http/Requests/RequestSendAdmin.php @@ -0,0 +1,30 @@ + + */ + public function rules() + { + return [ + // + ]; + } +} diff --git a/app/Mail/MailAdminy.php b/app/Mail/MailAdminy.php new file mode 100644 index 0000000..b7375b6 --- /dev/null +++ b/app/Mail/MailAdminy.php @@ -0,0 +1,66 @@ +data = $data; + } + + /** + * Get the message envelope. + * + * @return \Illuminate\Mail\Mailables\Envelope + */ + public function envelope() + { + return new Envelope( + subject: 'Mail Adminy', + ); + } + + /** + * Get the message content definition. + * + * @return \Illuminate\Mail\Mailables\Content + */ + public function content() + { + return new Content( + view: 'emails.send_adminy', + ); + } + + public function build() + { + // Вернуть все данные + return $this->view('emails.send_adminy', ['data' => $this->data]); + } + + /** + * Get the attachments for the message. + * + * @return array + */ + public function attachments() + { + return []; + } +} diff --git a/public/css/telegram.css b/public/css/telegram.css new file mode 100644 index 0000000..680f0a1 --- /dev/null +++ b/public/css/telegram.css @@ -0,0 +1,46 @@ +.btn_telegram_share { + display: inline-block; + text-align: center; + vertical-align: middle; + margin-right: 7px; + padding: 3px 10px; + border: 1px solid #54aaeb; + border-radius: 50px; + background: #54aaeb; + background: -webkit-gradient(linear, left top, left bottom, from(#54aaeb), to(#54aaeb)); + background: -moz-linear-gradient(top, #54aaeb, #54aaeb); + background: linear-gradient(to bottom, #54aaeb, #54aaeb); + font: normal normal normal 16px arial; + color: #ffffff; + text-decoration: none; +} +/*.btn_telegram_share:focus*/ +.btn_telegram_share:hover +{ + border: 1px solid #61c4ff; + background: #65ccff; + background: -webkit-gradient(linear, left top, left bottom, from(#65ccff), to(#65ccff)); + background: -moz-linear-gradient(top, #65ccff, #65ccff); + background: linear-gradient(to bottom, #65ccff, #65ccff); + color: #ffffff; + text-decoration: none; +} +.btn_telegram_share:active { + background: #32668d; + background: -webkit-gradient(linear, left top, left bottom, from(#32668d), to(#54aaeb)); + background: -moz-linear-gradient(top, #32668d, #54aaeb); + background: linear-gradient(to bottom, #32668d, #54aaeb); +} +.btn_telegram_share:before{ + content: "\0000a0"; + display: inline-block; + height: 24px; + width: 24px; + line-height: 24px; + margin: 0 4px -6px -4px; + position: relative; + top: 0px; + left: 0px; + background: url("http://Втавляем ссылку на свою картинку.png") no-repeat left center transparent; + background-size: 100% 100%; +} diff --git a/resources/views/emails/send_adminy.blade.php b/resources/views/emails/send_adminy.blade.php new file mode 100644 index 0000000..19e296e --- /dev/null +++ b/resources/views/emails/send_adminy.blade.php @@ -0,0 +1,7 @@ +