public function setReadMsgs()
 {
     $from_id = Input::get("from_id");
     $to_id = Input::get("to_id");
     $inbox_select = Inbox::select('id')->where('from_id', '=', $from_id)->where('to_id', '=', $to_id)->get();
     foreach ($inbox_select as $inbox_msg) {
         $inbox = Inbox::find($inbox_msg->id);
         $inbox->read = 1;
         $inbox->save();
     }
     return Response::json(array('validation_failed' => 0));
 }
Exemple #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function sendRead()
 {
     $members = Member::all();
     //all data of member collection
     $inbox_id = HelperController::getPage();
     $id = Auth::id();
     $author = User::find($id);
     $inbox = Inbox::find($inbox_id);
     //find data in Inbox collection
     $unread = Inbox::where('mail_read', '=', '0')->where('member_id', '=', $id)->get()->count();
     //mailbox view
     return view('vendor/flatAdmin/mailRead', compact(array('members', 'author', 'inbox', 'unread', 'id')));
 }