session()->get('status'); //1er magasin en base pour le moment $magasin = Magasin::first(); $content = Content::where('key', 'contact')->first(); return view('contact', compact('status', 'magasin', 'content')); } public function contactSubmit(ContactFormRequest $request) { $data = $request->all(); $toMailSetting = Setting::where('key', 'send_contact_mail_to')->first(); if(empty($toMailSetting->value)) { $toMail = config('mail.from.address'); } else { $toMail = $toMailSetting->value; } //envoi du mail d'alerte Mail::to($toMail)->send(new SendContactMail($request)); Mail::mailer('smtp2')->to($toMail)->send(new SendContactMail($request)); return back()->with('status', true); } }