public function addJawaban($id)
 {
     //edit Pertanyaan
     $UpdateDetails = Pertanyaan::find($id);
     $UpdateDetails->id_staff = \Auth::id();
     $UpdateDetails->jawaban = Input::get('jawaban');
     $UpdateDetails->save();
     $pertanyaan = Pertanyaan::find($id);
     $email = $pertanyaan->email;
     $nama = $pertanyaan->nama;
     Mail::send('emails.jawaban', ['pertanyaan' => $pertanyaan], function ($message) use($email, $nama) {
         $message->from('*****@*****.**', 'Koperasi Bandung');
         $message->to($email, $nama)->subject('Jawaban Anda');
     });
     return redirect()->back()->with('message', 'Pertanyaan telah dijawab');
 }
示例#2
0
 public static function deletePertanyaan($id)
 {
     $pertanyaan = Pertanyaan::find($id);
     $pertanyaan->delete();
 }