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


PHP Notification::count方法代码示例

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


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

示例1: index

 public function index()
 {
     $title = "Dashboard";
     $users = User::count();
     $notifications = Notification::count();
     $packages = Package::count();
     return view('admin.dashboard.index', compact('users', 'title', 'notifications', 'packages'));
 }
开发者ID:kimnv57,项目名称:laravel-simple-api-ueter-aide,代码行数:8,代码来源:DashboardController.php

示例2: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('layouts.master', function ($view) {
         $notification_obj = Notification::read(Auth::user()->id, true, 3);
         $notification_list = Notification::format($notification_obj);
         $view->with('user_notification_count', Notification::count(Auth::user()->id));
         $view->with('user_notification_list', $notification_list);
         $view->with('user_messages_count', Messages::countUnseen());
         $view->with('user_messages_list', Messages::topUnseen(3));
     });
     view()->composer('users.list', function ($view) {
         $view->with('company_id', User::where('id', Auth::user()->id)->with(['company' => function ($q) {
             $q->select('companies.id', 'companies.name');
         }])->first()->company->pluck('id')->toArray()[0] ?? "");
         $view->with('company_name', User::where('id', Auth::user()->id)->with(['company' => function ($q) {
             $q->select('companies.id', 'companies.name');
         }])->first()->company->pluck('name')->toArray()[0] ?? "");
     });
 }
开发者ID:svetlinyotov,项目名称:Timeline_v2.0,代码行数:24,代码来源:AppServiceProvider.php

示例3: showAllNotifications

 public function showAllNotifications($id = null)
 {
     if ($id == null) {
         $id = Auth::user()->id;
     }
     $notification_count = Notification::count($id);
     $notification_obj = Notification::read($id, false, 1000, 12);
     $notifications = Notification::format($notification_obj);
     $user = User::with('info')->where('id', $id)->first();
     return view('users.notifications')->with(['notifications' => $notifications, 'notifications_obj' => $notification_obj, 'notification_count' => $notification_count, 'user' => $user]);
 }
开发者ID:svetlinyotov,项目名称:Timeline_v2.0,代码行数:11,代码来源:UsersController.php


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