protected function adminHeader() { view()->composer('admin.partials.header', function ($view) { $view->with('headerData', ['notifications' => Notifications::where('user_id', Auth::user()->id)->orderBy('created_at', 'desc')->get(), 'messages' => Messages::where('status', 0)->orderBy('created_at', 'desc')->get()]); }); }
public function Notifications() { $input = Request::all(); $uID = $input['userid']; Notifications::where('user_ID', $uID)->update(['Status' => 'Read']); $notificount = Notifications::select('*')->where('user_id', $uID)->where('Status', 'Unread')->count(); return $notificount; }