File: /var/www/javago-portal-updates/app/View/Components/AppNavbar.php
<?php
namespace App\View\Components;
use App\Models\Notification;
use Illuminate\View\Component;
class AppNavbar extends Component
{
/**
* Create a new component instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render()
{
$notificationCount = Notification::where([['notification_type', 1], ['is_read', 0]])->count();
return view('components.app-navbar')->with('notificationCount', $notificationCount);
}
}