public function contactPost(Request $request) { $mails = Mail::with('object')->where('object_id', $request->get('subject'))->get(); foreach ($mails as $mail) { $this->sendMail($mail, $request->all()); } return redirect(route('contact'))->with('success', trans('contact.sent')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $mails = Mail::with('object')->get(); $title = 'Administration des emails'; return view('admin.mails.index', compact('mails', 'title')); }
public function mail() { $mails = Mail::with('novel')->with('chapter')->paginate(10); return view('mail', ['mails' => $mails, 'pageName' => 'mail']); }