New apps, version and all notification count and read issue solved. #2yrpaz9

This commit is contained in:
Cüneyt Şentürk
2022-06-10 11:14:18 +03:00
parent 2f99a5e5a0
commit 00f2a607e6
5 changed files with 69 additions and 24 deletions

View File

@ -3,7 +3,7 @@
namespace App\View\Components\Layouts\Admin;
use App\Abstracts\View\Component;
use App\Utilities\Versions;
use App\Events\Menu\NotificationsCreated;
class Menu extends Component
{
@ -21,10 +21,7 @@ class Menu extends Component
{
$this->companies = $this->getCompanies();
$version_update = Versions::getUpdates();
$this->notification_count = user()->unreadNotifications->count();
$this->notification_count += count($version_update);
$this->notification_count = $this->getNotificationCount();
return view('components.layouts.admin.menu');
}
@ -39,4 +36,16 @@ class Menu extends Component
return $companies;
}
public function getNotificationCount()
{
// Get nofitications
$notifications = new \stdClass();
$notifications->notifications = [];
$notifications->keyword = '';
event(new NotificationsCreated($notifications));
return $notifications->notifications->count();
}
}