mailToContact = new Address( Config::string('mail.to.contact') ); } public function showForm(Request $request, GetShopQuery $getShopQuery, GetPageQuery $getPageQuery): View { $status = $request->session()->get(self::SESSION_STATUS_KEY); $magasin = $this->executor->execute( $getShopQuery, new GetShopQueryInput(), ); $page = $this->executor->execute( $getPageQuery, new GetPageQueryInput( new Slug(strval(StaticPageSlug::CONTACT->value())) ), ); return view('fo.pages.contact', compact( 'status', 'magasin', 'page' )); } public function submitForm(ContactFormRequest $request, SubmitContactForm $action): RedirectResponse { $contactData = $this->executor->execute( $action, $request->toSubmitContactFormInput(), ); SendContactMailJob::dispatch( $contactData, $this->mailToContact->address, $this->mailToContact->name, ); return back()->with(self::SESSION_STATUS_KEY, true); } }