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


PHP Notification::find方法代码示例

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


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

示例1: flag

 public function flag(Request $request)
 {
     $notification = Notification::find($request->input('notification_id'));
     $notification->flagged = true;
     $notification->save();
     return response()->json(['response' => 'success', 'notification' => $notification]);
 }
开发者ID:BenjaminPrice,项目名称:debthack-backend,代码行数:7,代码来源:NotificationsController.php

示例2: open

 public function open($id)
 {
     $notification = Notification::find($id);
     $notification->seen = 1;
     $notification->save();
     $notifications = \Auth::user()->notifications()->where('seen', '0')->get();
     if (count($notifications) == 0) {
         return response()->json('empty');
     }
     return response()->json('success');
 }
开发者ID:RuseHackV2,项目名称:MeetUpr,代码行数:11,代码来源:NotificationController.php

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $notification_id = $request->query('notification');
     if ($notification_id) {
         if (Auth::check()) {
             $user = Auth::user();
             $notification = Notification::find($notification_id);
             if ($notification->user_id == $user->id) {
                 $notification->is_read = true;
                 $notification->save();
             }
         }
     }
     return $next($request);
 }
开发者ID:Clazance,项目名称:developer-shame,代码行数:22,代码来源:ClearNotification.php

示例4: received

 public function received($id)
 {
     $handle = Notification::find($id);
     $handle->is_read = 1;
     $handle->save();
     switch ($handle->type) {
         case 'message':
             return redirect('/messages/' . $handle->getObject()->id);
             break;
         case 'friend_invite':
             return redirect(url('/user/' . $handle->getObject()->id));
             break;
         case 'post':
             return redirect('/post/' . $handle->getObject()->id);
             break;
         case 'comment':
             return redirect('/post/' . $handle->getObject()->id);
         default:
             print_r($handle->type);
             break;
     }
 }
开发者ID:eldorplus,项目名称:laravel5.1_social_network,代码行数:22,代码来源:NotificationsController.php

示例5:

<?php

use App\User;
use App\Worker;
use App\Branch;
use App\UserLevel;
use App\Notification;
use App\Provider;
use App\ProviderBill;
use App\ProviderBillBreakdown;
use App\Stock;
$currentNotification = Notification::find($notification);
$currentNotification->Seen = true;
$currentNotification->save();
$permissions = json_decode(UserLevel::find(Auth::user()->UserLevel)->Permissions);
$provider = Provider::find($pId);
$bill = ProviderBill::where('ProviderId', '=', $pId)->where('BillNumber', '=', $bill)->first();
$billBreakdown = ProviderBillBreakdown::where('ProviderBillId', '=', $bill->Id)->get();
$worker = Worker::find(Auth::user()->TypeId);
$total = 0;
?>
<!DOCTYPE html>
<html lang="es">
    <head>
        <title>Eirene Systema Administrativo</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta charset="UTF-8">
        <meta name="csrf-token" content="{{{ Session::token() }}}">
        <link href="{{ URL::to('/') }}/css/bootstrap.min.css" rel="stylesheet">
        <link href="{{ URL::to('/') }}/css/bootstrap-responsive.min.css" rel="stylesheet">
开发者ID:patrickdamery,项目名称:Eirene,代码行数:31,代码来源:bill.blade.php

示例6: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $notification = Notification::find($id);
     $notification->delete();
     return 'deleted';
 }
开发者ID:amatelic,项目名称:skavti,代码行数:12,代码来源:NotificationController.php

示例7: markAsRead

 public static function markAsRead($notification_id)
 {
     $notification = Notification::find($notification_id);
     $notification->is_read = 1;
     $notification->save();
 }
开发者ID:svetlinyotov,项目名称:Timeline_v2.0,代码行数:6,代码来源:Notification.php

示例8: edit

 /**
  * 编辑消息
  *
  * @param int $id
  * @return void
  */
 public function edit($id)
 {
     return View::make('admin/notifications/edit')->with('notification', Notification::find($id));
 }
开发者ID:popfeng,项目名称:zao,代码行数:10,代码来源:NotificationsController.php

示例9: deleteNotif

 public function deleteNotif($idNotif)
 {
     $notif = Notification::find($idNotif);
     $notif->seen = 1;
     $notif->save();
 }
开发者ID:flelievre,项目名称:Museek,代码行数:6,代码来源:NotificationRepository.php

示例10: postDelete

 /**
  * Remove the specified resource from storage.
  *
  * @param $Notification
  * @return Response
  */
 public function postDelete(DeleteRequest $request, $id)
 {
     $notification = Notification::find($id);
     $notification->delete();
     return redirect('admin/notifications');
 }
开发者ID:kimnv57,项目名称:laravel-simple-api-ueter-aide,代码行数:12,代码来源:NotificationController.php

示例11: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id, Request $request, NotificationRequest $notificationRequest)
 {
     //
     $fields = $request->except('optionsRadios', 'email');
     $notification = Notification::find($id);
     if (!isset($fields['user_id'])) {
         $fields['user_id'] = NULL;
     }
     if (!isset($fields['role_id'])) {
         $fields['role_id'] = NULL;
     }
     if ($request->get('email') == 1) {
         if (strcmp($request->get('optionsRadios'), "users") == 0) {
             $user_id = $request->get('user_id');
             $user = User::findOrFail($user_id);
             Mail::send('emails.notification', ['user' => $user, 'fields' => $fields], function ($m) use($user, $fields) {
                 $m->to($user->email)->subject('Usted tiene una nueva notificación ' . $fields['title']);
             });
         } else {
             $role_id = $request->get('role_id');
             $role = Sentinel::findRoleById($role_id);
             $users = $role->users()->with('roles')->get();
             foreach ($users as $user) {
                 Mail::send('emails.notification', ['user' => $user, 'fields' => $fields], function ($m) use($user, $fields) {
                     $m->to($user->email)->subject('Usted tiene una nueva notificación ' . $fields['title']);
                 });
             }
         }
     }
     $notification->fill($fields);
     $notification->save();
     return \Redirect::to('notifications')->withSuccess('La notificación se ha sido actualizado.');
 }
开发者ID:gitfreengers,项目名称:larus,代码行数:39,代码来源:NotificationsController.php


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