Update profile pages design
This commit is contained in:
@@ -20,10 +20,17 @@ class NotificationController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Notifcation
|
||||
* Delete a notification or clear all.
|
||||
*/
|
||||
public function delete(Request $request): RedirectResponse
|
||||
{
|
||||
// Clear all notifications if no specific ID is provided
|
||||
if (! $request->has('id')) {
|
||||
$request->user()->notifications()->delete();
|
||||
|
||||
return redirect()->back()->with('status', 'notifications-cleared');
|
||||
}
|
||||
|
||||
$request->validate([
|
||||
'id' => 'required|exists:notifications,id',
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user