Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v2' into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
punkestu committed Nov 3, 2024
2 parents 94e1edc + 36815e5 commit bf8ea48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/Http/Controllers/NotificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ class NotificationController extends Controller
{
public function index()
{
$notifications = auth()->user()->profile->cabang->notifications;
Notification::where('to', auth()->user()->profile->cabang->id)->update(['is_read' => true]);
if(auth()->user()->profile->cabang) {
$notifications = auth()->user()->profile->cabang->notifications;
Notification::where('to', auth()->user()->profile->cabang->id)->update(['is_read' => true]);
} else {
$notifications = [];
}
return view('notification.index', compact('notifications'));
}
}
2 changes: 1 addition & 1 deletion resources/views/components/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class="max-h-0 duration-300 absolute flex flex-col gap-1 bg-white mt-4 text-gray
@endphp
<a href="/rotasi/notification"
class="flex aspect-square border-2 rounded-full p-1 {{ $hasNotification ? 'border-blue-500' : 'border-gray-800' }}">
<svg class="w-6 h-6 {{ $hasNotification ? 'text-blue-500' : 'text-gray-800 dark:text-white' }}"
<svg class="w-6 h-6 {{ $hasNotification ? 'text-blue-500' : 'text-gray-800' }}"
aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
viewBox="0 0 24 24">
<path
Expand Down

0 comments on commit bf8ea48

Please sign in to comment.