public function saveContact(Request $req) { $Pesan = new Pesan(); $Pesan->nama = $req->nama; $Pesan->email = $req->email; $Pesan->subjek = $req->subject; $Pesan->pesan = $req->pesan; $Pesan->save(); }
/** * Fungsi untuk Save reply yang admin kirim * @param int $id */ public function saveEmail(Request $request) { $testing = Contact::latest()->first(); $pesan = new Pesan(); $pesan->email = $request->get('email'); $pesan->name = $request->get('name'); $pesan->message = $request->get('message'); $pesan->save(); $reply = Pesan::latest()->first(); Mail::send('emails.reply', ['reply' => $reply], function ($message) use($reply) { $message->to($reply->email)->subject('Membalas Pertanyaan Anda'); }); $user = Auth::user(); $contact = Contact::all(); $count = DB::table('pesans')->count(); $count2 = DB::table('contacts')->count(); return Redirect('admin')->with('user', 'contact', 'count', 'count2'); }
public function getUpdateNotif() { Pesan::where('baru', 1)->update(['baru' => 0]); }
public function index() { $jml_berita = Blog::where('draft', 0)->where('arsip', 0)->count(); $jml_pesan_baru = Pesan::where('baru', 1)->where('tipe', 'Masuk')->count(); return view('admin.beranda.index', compact(['jml_berita', 'jml_pesan_baru'])); }