Skip to content

Commit

Permalink
Update NotificationController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
punkestu authored Oct 31, 2024
1 parent 32188d7 commit 86a9786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/NotificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class NotificationController extends Controller
{
public function index()
{
$notifications = auth()->user()->profile->cabang->notifications;
$notifications = auth()->user()->profile->cabang ? auth()->user()->profile->cabang->notifications : [];
Notification::where('to', auth()->user()->profile->cabang->id)->update(['is_read' => true]);
return view('notification.index', compact('notifications'));
}
Expand Down

0 comments on commit 86a9786

Please sign in to comment.