<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class NotificationController extends Controller
{
    public function markAllRead()
    {
        auth()->user()->unreadNotifications->markAsRead();
        return back()->with('success', 'Semua notifikasi telah ditandai sudah dibaca.');
    }
    
    public function clearAll()
    {
        auth()->user()->notifications()->delete();
        return back()->with('success', 'Semua notifikasi berhasil dihapus.');
    }
}
