src/User/User.php
protected function getUnreadNotifications()
    {
        static $cached = null;

        if (is_null($cached)) {
            $cached = $this->notifications()
                ->whereIn('type', $this->getAlertableNotificationTypes())
                ->whereNull('read_at')
                ->where('is_deleted', false)
                ->whereSubjectVisibleTo($this)
                ->get();
        }

        return $cached;
    }
protected function getUnreadNotifications()
    {
        static $cached = null;

        if (is_null($cached)) {
            $cached = $this->notifications()
                ->whereIn('type', $this->getAlertableNotificationTypes())
                ->whereNull('read_at')
                ->where('is_deleted', false)
                ->whereSubjectVisibleTo($this)
                ->get();
        }

        return $cached;
    }
protected function getUnreadNotifications ( ) { static $ cached = null ; if ( is_null ( $ cached ) ) { $ cached = $ this -> notifications ( ) -> whereIn ( 'type' , $ this -> getAlertableNotificationTypes ( ) ) -> whereNull ( 'read_at' ) -> where ( 'is_deleted' , false ) -> whereSubjectVisibleTo ( $ this ) -> get ( ) ; } return $ cached ; }
Get all notifications that have not been read yet.

@return \Illuminate\Database\Eloquent\Collection
Get all notifications that have not been read yet .