/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * * @return \Illuminate\Http\Response */ public function store(Request $request) { $emailstat = new Emaildrop(); $emailstat->sender = $request->input('sender'); $emailstat->subject = $request->input('subject'); $emailstat->Spf = $request->input('X-Mailgun-Spf'); $emailstat->Spamscore = $request->input('X-Mailgun-Sscore'); $emailstat->Spamflag = $request->input('X-Mailgun-Sflag'); $emailstat->DkimCheck = $request->input('X-Mailgun-Dkim-Check-Result'); $emailstat->public = $request->input('public'); $emailstat->recipient = $request->input('recipient'); $emailstat->bodyplain = $request->input('body-plain'); $emailstat->messageheaders = $request->input('message-headers'); $emailstat->save(); }
/** * @return mixed */ public function getEmailDropsChart() { $dataTableRows = Emaildrop::select(DB::raw("DATE_FORMAT(created_at, '%Y-%m-%d') as Date, COUNT('id') AS Count"))->groupBy(DB::raw("DATE_FORMAT(created_at, '%Y-%m-%d')"))->orderby('Date', 'asc')->take(100)->get(); $dataTableColumns = [['date', 'Date'], ['number', 'Count']]; $name = 'emaildrops'; $title = 'Droped by custom rule'; $dateFormat = 'Y-m-d'; return (new Chart\LineChartController())->createLineChart($name, $title, $dataTableColumns, $dataTableRows, $dateFormat); }
/** * Display the specified resource. * * @param int $id * * @return \Illuminate\Http\Response */ public function show($id) { $title = 'EmailDrop ' . $id; $emailDrop = Emaildrop::find($id); return view('admin.dashboard.emaildrop.EmailDrop', ['title' => $title, 'emaildrop' => $emailDrop]); }
/** * @return \BladeView|bool|\Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function index() { $title = 'Dashboard'; $emailDrop = Emaildrop::count(); return view('admin.dashboard.index', compact('title', 'emailDrop', 'externalApiLimits')); }