本文整理汇总了PHP中app\Message::whereIn方法的典型用法代码示例。如果您正苦于以下问题:PHP Message::whereIn方法的具体用法?PHP Message::whereIn怎么用?PHP Message::whereIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Message
的用法示例。
在下文中一共展示了Message::whereIn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mutilDestroy
/**
* Remove the specified resource from storage.
*
* @param MessageRequest $request
* @return Response
*/
public function mutilDestroy(MessageRequest $request)
{
Message::whereIn('id', $request->input('checkbox'))->delete();
return new JsonResponse(['message' => Lang::get('message.destroy')], 200);
}
示例2: getShortDescription
public function getShortDescription(Request $request)
{
//fetching all the receipient ids
$userId = Auth::user()->email;
$message = MessageReceipient::where('receipient_ID', $userId)->get();
$metaIds = array();
//fetching meta ids and storing in the array
foreach ($message as $key => $value) {
$metaIds[] = $value['meta_Id'];
}
//getting all the message corresponding to a user
$message = Message::whereIn('meta_Id', $metaIds)->groupBy('from')->get();
foreach ($message as $key => $value) {
//fetching user id on the basis of email
$email = $value['from'];
$userName = User::where('email', $email)->pluck('id');
//converting time into epoch value
$epoch = strtotime($value['created_at']);
$value['epoch'] = $epoch;
//user name on the basis of email
if ($value['from'] == $userId) {
//if message is sending by logged in user set "me"
$value['from'] = "Me";
} else {
//if message is sending by other email address then set user name instead of email id
$value['from'] = UserDetail::where('userid', $userName)->pluck('name');
}
//getting user profile picture path
$profilePic = UserDetail::where('userid', $userName)->pluck('profilePicPath');
$value['path'] = $profilePic;
}
return $message;
}