Issues (48)

View/Components/AnnouncementNotificationBell.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Adminetic\Announcement\View\Components;
4
5
use Illuminate\Support\Facades\Auth;
6
use Illuminate\View\Component;
7
8
class AnnouncementNotificationBell extends Component
9
{
10
    /**
11
     * Create a new component instance.
12
     *
13
     * @return void
14
     */
15
    public function __construct()
16
    {
17
        //
18
    }
19
20
    /**
21
     * Get the view / contents that represent the component.
22
     *
23
     * @return \Illuminate\Contracts\View\View|\Closure|string
24
     */
25
    public function render()
26
    {
27
        $unread_notifications = Auth::user()->unreadNotifications;
0 ignored issues
show
Accessing unreadNotifications on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
28
29
        return view('announcement::admin.components.announcement-notification-bell', compact('unread_notifications'));
30
    }
31
}
32