当前位置: 首页>>代码示例>>PHP>>正文


PHP Message::all方法代码示例

本文整理汇总了PHP中app\Message::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Message::all方法的具体用法?PHP Message::all怎么用?PHP Message::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Message的用法示例。


在下文中一共展示了Message::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: numberUnreadMessages

 public function numberUnreadMessages()
 {
     $count = 0;
     foreach (\App\Message::all() as $message) {
         if ($message->to == \Auth::User()->id && $message->read == 0) {
             $count++;
         }
     }
     return $count;
 }
开发者ID:steakyfask,项目名称:ShareStuff,代码行数:10,代码来源:User.php

示例2: getMessage

 /**
  * To handle all the mesaging functionality
  *
  * @param  int  $id
  * @return Response
  */
 public function getMessage(Request $request)
 {
     $userId = Auth::user()->email;
     $messageReceipaient = MessageReceipient::where('receipient_ID', $userId)->get();
     $metaIds = array();
     //storing all the message recepiaent
     foreach ($messageReceipaient as $key => $value) {
         $metaIds[] = $value['meta_Id'];
     }
     //fetching all the message to display
     $messageReceipaientResult = Message::all();
     return $messageReceipaientResult;
 }
开发者ID:shrastisoni,项目名称:bul1,代码行数:19,代码来源:MessageController.php

示例3: onMessage

 public function onMessage(ConnectionInterface $from, $msg)
 {
     $numRecv = count($this->clients) - 1;
     echo sprintf('Connection %d sending message "%s" to %d other connection%s' . "\n", $from->resourceId, $msg, $numRecv, $numRecv == 1 ? '' : 's');
     $data = json_decode($msg);
     if ($data->status == 'ping') {
         $data->status == 'pong';
         $from->send(json_encode($data));
     }
     if ($data->status == 'open') {
         $current_user = \App\ChatOnlineUser::where('username', '=', $data->username)->first();
         print_r(empty((array) $current_user));
         if (!empty($current_user)) {
             \App\ChatOnlineUser::where('username', '=', $data->username)->delete();
         }
         $chat_user_data = array('username' => $data->username, 'name' => $data->name, 'connection_resource_id' => $from->resourceId);
         $online_users = \App\ChatOnlineUser::all();
         $data->online_users = $online_users->toArray();
         \App\ChatOnlineUser::create($chat_user_data);
         $messages = \App\Message::all();
         $data->content = $messages->toArray();
         foreach ($this->clients as $client) {
             //if ($from !== $client) {
             $client->send(json_encode($data));
             //}
         }
     }
     if ($data->status == 'close') {
         foreach ($this->clients as $client) {
             if ($from !== $client) {
                 $client->send($msg);
             }
         }
     }
     if ($data->status == 'message') {
         $message_data = array('username' => $data->username, 'name' => $data->name, 'message_contents' => $data->content);
         \App\Message::create($message_data);
         foreach ($this->clients as $client) {
             if ($from !== $client) {
                 $client->send($msg);
             }
         }
     }
 }
开发者ID:kranti52,项目名称:LaravelRatchetChatRoom,代码行数:44,代码来源:Chat.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Message::all()->toJson();
 }
开发者ID:pjztam,项目名称:PiedPiper,代码行数:9,代码来源:MessageController.php

示例5: discussion

 /**
  * Display Project Discussion page
  *
  * @return \Illuminate\View\View
  */
 public function discussion()
 {
     $messages = Message::all();
     return view('projects.discussion', compact('messages'));
 }
开发者ID:AlexAustralia,项目名称:printflow,代码行数:10,代码来源:ProjectsController.php

示例6: index

 public function index()
 {
     $data['chats'] = Message::all();
     return view('index', $data);
 }
开发者ID:efrontsa,项目名称:messages-demo,代码行数:5,代码来源:ChatController.php

示例7: function

# ------------------ bookmark stuff ------------------------
post('api/bookmark', function () {
    Auth::user()->bookmark = Request::get('bookmark');
    Auth::user()->save();
});
get('api/bookmark', function () {
    return Auth::user()->bookmark;
});
# ------------------ guestbook stuff ------------------------
use App\Message;
get('guestbook', function () {
    return view('guestbook/guestbook');
});
// API
get('api/messages', function () {
    return App\Message::all();
});
post('api/messages', function () {
    return App\Message::create(Request::all());
});
# ------------------ Password reset stuff ------------------------
// Password reset link request routes...
Route::get('password/email', 'Auth\\PasswordController@getEmail');
Route::post('password/email', 'Auth\\PasswordController@postEmail');
// Password reset routes...
Route::get('password/reset/{token}', 'Auth\\PasswordController@getReset');
Route::post('password/reset', 'Auth\\PasswordController@postReset');
#  ------------------admin info stuff (建设中)------------------------
// Route::resource('info','InfoController');
// get('info', function() {
//     return view('guestbook/guestbook');
开发者ID:stevejobsii,项目名称:gg,代码行数:31,代码来源:routes.php

示例8: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $data['messages'] = Message::all();
     $data['showCreateMessage'] = true;
     return \View::make('messages.index')->with($data);
 }
开发者ID:christengc,项目名称:wheel,代码行数:11,代码来源:MessagesController.php

示例9: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $message = Message::all();
     return view('pages.home')->with('message', $message);
 }
开发者ID:kuzoncby,项目名称:CRUD-Laravel-5-Message-Board,代码行数:10,代码来源:MessageController.php

示例10: all

 /**
  * View all messages
  *
  * @return \Illuminate\Database\Eloquent\Collection|static[]
  */
 public function all()
 {
     $messages = Message::all();
     return $messages;
 }
开发者ID:alexisribault,项目名称:sniip,代码行数:10,代码来源:TextRepository.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return response()->json(Message::all());
 }
开发者ID:williamfunchal,项目名称:SocialBaseTest,代码行数:9,代码来源:MessagesController.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $messages = Message::all();
     return View::make('MessageBoard', ['message_view' => $messages]);
 }
开发者ID:Chiene,项目名称:Laravel_basic_tutorial,代码行数:10,代码来源:MessageBoardController.php

示例13: getUnlinkedMessages

 /**
  * Get Messages that are not linked to the Layout ID provided.
  *
  * @param  \Layout ID
  */
 public function getUnlinkedMessages($elementId)
 {
     //$unlinkedMessages = Message::all();
     //return $unlinkedMessages;
     //Find all elements related to a Layout
     $linkedMessages = ElementsController::getMessages($elementId);
     //Get the messages that are related to id
     $linkedMessagesId = $linkedMessages->lists('id');
     if (count($linkedMessagesId) == 0) {
         //If there is no related elements, return all available elements.
         return Message::all();
     } else {
         //If there is related elements, find the ones that are not related
         return Message::whereNotIn('id', $linkedMessagesId)->get();
     }
 }
开发者ID:christengc,项目名称:wheel,代码行数:21,代码来源:ElementsController.php

示例14: senderRequest

 public function senderRequest()
 {
     $senders = Sender::all();
     $receivers = Receiver::all();
     $messages = Message::all();
     foreach ($senders as $sender) {
         $pk_sender = $sender->private_key;
     }
     foreach ($receivers as $receiver) {
         $pk_receiver = $receiver->private_key;
     }
     foreach ($messages as $message) {
         $v = $message->text_message;
     }
     $str = "";
     $len = strlen($v);
     for ($y = 0; $y < $len; $y++) {
         $swap = 0;
         if ($v[$y] == 'A' || $v[$y] == 'a') {
             $swap = 1;
         }
         if ($v[$y] == 'B' || $v[$y] == 'b') {
             $swap = 2;
         }
         if ($v[$y] == 'C' || $v[$y] == 'c') {
             $swap = 3;
         }
         if ($v[$y] == 'D' || $v[$y] == 'd') {
             $swap = 4;
         }
         if ($v[$y] == 'E' || $v[$y] == 'e') {
             $swap = 5;
         }
         if ($v[$y] == 'F' || $v[$y] == 'f') {
             $swap = 6;
         }
         if ($v[$y] == 'G' || $v[$y] == 'g') {
             $swap = 7;
         }
         if ($v[$y] == 'H' || $v[$y] == 'h') {
             $swap = 8;
         }
         if ($v[$y] == 'I' || $v[$y] == 'i') {
             $swap = 9;
         }
         if ($v[$y] == 'J' || $v[$y] == 'j') {
             $swap = 10;
         }
         if ($v[$y] == 'K' || $v[$y] == 'k') {
             $swap = 11;
         }
         if ($v[$y] == 'L' || $v[$y] == 'l') {
             $swap = 12;
         }
         if ($v[$y] == 'M' || $v[$y] == 'm') {
             $swap = 13;
         }
         if ($v[$y] == 'N' || $v[$y] == 'n') {
             $swap = 14;
         }
         if ($v[$y] == 'O' || $v[$y] == 'o') {
             $swap = 15;
         }
         if ($v[$y] == 'P' || $v[$y] == 'p') {
             $swap = 16;
         }
         $m = $swap;
         $r = $pk_sender;
         $s = $pk_receiver;
         $r1 = pow(3, $r) % 17;
         $s1 = pow(3, $s) % 17;
         $r2 = pow($s1, $r) % 17;
         $s2 = pow($r1, $s) % 17;
         $c = $r2 * $m % 17;
         if ($c == 1) {
             $str = $str . "A";
         }
         if ($c == 2) {
             $str = $str . "B";
         }
         if ($c == 3) {
             $str = $str . "C";
         }
         if ($c == 4) {
             $str = $str . "D";
         }
         if ($c == 5) {
             $str = $str . "E";
         }
         if ($c == 6) {
             $str = $str . "F";
         }
         if ($c == 7) {
             $str = $str . "G";
         }
         if ($c == 8) {
             $str = $str . "H";
         }
         if ($c == 9) {
             $str = $str . "I";
//.........这里部分代码省略.........
开发者ID:KaranPittie,项目名称:zeta,代码行数:101,代码来源:senderController.php

示例15: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $messages = Message::all();
     return view('admin.inbox', compact('messages'));
 }
开发者ID:BartSchop,项目名称:schoolproject,代码行数:10,代码来源:AdminController.php


注:本文中的app\Message::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。