From d9da475084b3eef4e28d7150295b77bdd4f8995b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Tue, 18 Jun 2024 12:52:11 +0300 Subject: [PATCH] changes for tasks 1 and 2 --- app/Http/Controllers/EmployerController.php | 5 ++ app/Mail/MailCreateEmployer.php | 66 +++++++++++++++++++++++++++ resources/views/emails/create_emp.blade.php | 6 +++ 3 files changed, 77 insertions(+) create mode 100644 app/Mail/MailCreateEmployer.php create mode 100644 resources/views/emails/create_emp.blade.php diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index 7af8e90..1d82278 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -10,6 +10,8 @@ use App\Http\Requests\FlotRequest; use App\Http\Requests\MessagesRequiest; use App\Http\Requests\VacancyRequestEdit; use App\Http\Requests\VacansiaRequiest; +use App\Mail\MailAdminy; +use App\Mail\MailCreateEmployer; use App\Mail\MailSotrudnichestvo; use App\Mail\SendAllMessages; use App\Models\Ad_employer; @@ -476,6 +478,9 @@ class EmployerController extends Controller } else { $user = $this->create($params); event(new Registered($user)); + + Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params)); + Auth::guard()->login($user); } diff --git a/app/Mail/MailCreateEmployer.php b/app/Mail/MailCreateEmployer.php new file mode 100644 index 0000000..68952a7 --- /dev/null +++ b/app/Mail/MailCreateEmployer.php @@ -0,0 +1,66 @@ +data = $data; + } + + /** + * Get the message envelope. + * + * @return \Illuminate\Mail\Mailables\Envelope + */ + public function envelope() + { + return new Envelope( + subject: 'Mail Create Employer', + ); + } + + /** + * Get the message content definition. + * + * @return \Illuminate\Mail\Mailables\Content + */ + public function content() + { + return new Content( + view: 'emails.create_emp', + ); + } + + public function build() + { + // Вернуть все данные + return $this->view('emails.create_emp', ['data' => $this->data]); + } + + /** + * Get the attachments for the message. + * + * @return array + */ + public function attachments() + { + return []; + } +} diff --git a/resources/views/emails/create_emp.blade.php b/resources/views/emails/create_emp.blade.php new file mode 100644 index 0000000..842badf --- /dev/null +++ b/resources/views/emails/create_emp.blade.php @@ -0,0 +1,6 @@ +
+ Зарегистрирован новый работодатель: {{ $data['surname']." ".$data['name_man']." ".$data['surname2'] }}
+ Email: {{ $data['email'] }}
+ Название компании: {{ $data['name_company'] }}
+ Телефон: {{ $data['telephone'] }}
+
-- 1.7.10.4