Пример #1
0
 public function postAddMessage()
 {
     if (!Auth::check()) {
         return Response::json(array('status' => 'error', 'message' => trans(CLF_LANG_MESSAGE . 'require_signin')), 500);
     }
     $result = null;
     //MessageThreads::addThread(1, 2, "Test message");
     MessageRecipients::getInboxCount(2);
     //MessageThreads::userIsSender(1);
     return Response::json(response_message(200, $result));
 }
Пример #2
0
 public static function checkAccess($thread_id, $user_id = 0)
 {
     if (empty($user_id) || empty($thread_id)) {
         return null;
     }
     if (empty($user_id)) {
         $user_id = Auth::getUser()->id;
     }
     return MessageRecipients::whereRaw('thread_id = ? AND is_deleted = 0 AND user_id = ?', array($thread_id, $user_id))->count();
 }