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


PHP Notification::with方法代码示例

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


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

示例1: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('includes-update.header', function ($view) {
         $thanksCount = 0;
         $followCount = 0;
         if (Auth::user()->identifier == 1 || Auth::user()->identifier == 3) {
             $user = Induser::where('id', '=', Auth::user()->induser_id)->first();
             $favourites = Postactivity::with('user')->where('fav_post', '=', 1)->where('user_id', '=', Auth::user()->id)->orderBy('id', 'desc')->get(['id', 'fav_post', 'fav_post_dtTime', 'user_id', 'post_id']);
             $thanksCount = Postactivity::with('user', 'post')->join('postjobs', 'postjobs.id', '=', 'postactivities.post_id')->where('postjobs.individual_id', '=', Auth::user()->induser_id)->where('postactivities.thanks', '=', 1)->orderBy('postactivities.id', 'desc')->sum('postactivities.thanks');
             $linksCount = Connections::where('user_id', '=', Auth::user()->induser_id)->where('status', '=', 1)->orWhere('connection_user_id', '=', Auth::user()->induser_id)->where('status', '=', 1)->count('id');
             $linkrequestCount = Connections::where('connection_user_id', '=', Auth::user()->induser_id)->where('status', '=', 0)->count('id');
             $groupCount = Groups_users::where('user_id', '=', Auth::user()->induser_id)->count('id');
             $postCount = Postjob::where('individual_id', '=', Auth::user()->induser_id)->count('id');
             $profilePer = 0;
             if (Auth::user()->induser->fname != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->lname != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->email != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->mobile != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->dob != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->city != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->fb_page != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->in_page != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->gender != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->about_individual != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->education != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->experience != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->working_status != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->working_at != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->role != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->linked_skill != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->resume != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->prefered_location != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->prefered_jobtype != null) {
                 $profilePer = $profilePer + 1;
             }
             if (Auth::user()->induser->profile_pic != null) {
                 $profilePer = $profilePer + 1;
             }
             $profilePer = round($profilePer / 20 * 100);
         } else {
             if (Auth::user()->identifier == 2 || Auth::user()->identifier == 3) {
                 $user = Corpuser::where('id', '=', Auth::user()->corpuser_id)->first();
                 $followCount = Follow::where('corporate_id', '=', 1)->orWhere('individual_id', '=', 1)->count('id');
                 $linksCount = "";
                 $linkrequestCount = "";
                 $groupCount = "";
                 $postCount = Postjob::where('corporate_id', '=', Auth::user()->corpuser_id)->count('id');
                 $favourites = Postactivity::with('user')->where('fav_post', '=', 1)->where('user_id', '=', Auth::user()->id)->orderBy('id', 'desc')->get(['id', 'fav_post', 'fav_post_dtTime', 'user_id', 'post_id']);
                 $profilePer = 0;
                 if (Auth::user()->corpuser->firm_name != null) {
                     $profilePer = $profilePer + 1;
                 }
                 if (Auth::user()->corpuser->username != null) {
                     $profilePer = $profilePer + 1;
                 }
                 if (Auth::user()->corpuser->firm_type != null) {
                     $profilePer = $profilePer + 1;
                 }
                 if (Auth::user()->corpuser->emp_count != null) {
//.........这里部分代码省略.........
开发者ID:devvicky,项目名称:Jobb-new,代码行数:101,代码来源:UserServiceProvider.php

示例2: profile

 public function profile($utype, $id)
 {
     $title = 'profile';
     if ($utype == 'ind') {
         $user = Induser::with('user')->findOrFail($id);
         // $thanks = Postactivity::with('user', 'post')
         // 				      ->join('postjobs', 'postjobs.id', '=', 'postactivities.post_id')
         // 					  ->where('postjobs.individual_id', '=', $id)
         // 					  ->where('postactivities.thanks', '=', 1)
         // 				      ->orderBy('postactivities.id', 'desc')
         // 				      ->sum('postactivities.thanks');
         $posts = Postjob::where('individual_id', '=', $id)->count('id');
         $linksCount = Connections::where('user_id', '=', $id)->where('status', '=', 1)->orWhere('connection_user_id', '=', $id)->where('status', '=', 1)->count('id');
         $connectionPendingStatus = Connections::where('user_id', '=', Auth::user()->induser_id)->where('connection_user_id', '=', $id)->first(['status']);
         $connectionRequestStatus = Connections::where('connection_user_id', '=', Auth::user()->induser_id)->where('user_id', '=', $id)->first(['status', 'id']);
         $notifications = Notification::with('fromUser', 'toUser')->where('to_user', '=', Auth::user()->id)->orderBy('id', 'desc')->get();
         $thanks = Postactivity::with('user', 'post')->join('postjobs', 'postjobs.id', '=', 'postactivities.post_id')->where('postjobs.individual_id', '=', $id)->where('postactivities.thanks', '=', 1)->orderBy('postactivities.id', 'desc')->get();
         // connection status
         $connectionStatus = 'add';
         $connectionId = 'unknown';
         if ($connectionPendingStatus != null && $connectionPendingStatus->status == 0) {
             $connectionStatus = 'requestsent';
         } elseif ($connectionPendingStatus != null && $connectionPendingStatus->status == 1) {
             $connectionStatus = 'friend';
         } elseif ($connectionRequestStatus != null && $connectionRequestStatus->status == 0) {
             $connectionStatus = 'pendingrequest';
             $connectionId = $connectionRequestStatus->id;
         } elseif ($connectionRequestStatus != null && $connectionRequestStatus->status == 1) {
             $connectionStatus = 'friend';
         }
         // $taggedPosts = $this->usersPost();
         $taggedGroupPosts = $this->usersGroupPost();
         $followingPost = $this->followingPost();
     } elseif ($utype == 'corp') {
         $user = Corpuser::with('user')->findOrFail($id);
         $thanks = Postactivity::with('user', 'post')->join('postjobs', 'postjobs.id', '=', 'postactivities.post_id')->where('postjobs.corporate_id', '=', $id)->where('postjobs.inactive', '=', 0)->where('postactivities.thanks', '=', 1)->orderBy('postactivities.id', 'desc')->sum('postactivities.thanks');
         $posts = Postjob::where('corporate_id', '=', $id)->count('id');
         $linksCount = Follow::where('corporate_id', '=', $id)->count('id');
         $followCount = Follow::where('corporate_id', '=', $id)->orWhere('individual_id', '=', $id)->count('id');
         $connectionStatus = 'unknown';
         $followStatus = Follow::where('individual_id', '=', Auth::user()->induser_id)->first();
         if ($followStatus != null) {
             $connectionStatus = 'following';
             $connectionId = $followStatus->id;
         }
         // $taggedPosts = $this->usersPost();
         $taggedGroupPosts = $this->usersGroupPost();
         $followingPost = $this->followingPost();
     }
     return view('pages.profile_view', compact('title', 'thanks', 'posts', 'linksCount', 'user', 'connectionStatus', 'utype', 'connectionId', 'followCount', 'linkSharePost', 'taggedGroupPosts', 'followingPost', 'notifications'));
 }
开发者ID:devvicky,项目名称:Jobb-new,代码行数:51,代码来源:PagesController.php


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