lms/app/Http/Controllers/NotificationController.php
Ahmed Darrazi dedcb041c5
All checks were successful
Build & Push Docker Image / docker (push) Successful in 1m54s
Übersetze NotificationController Nachricht ins Deutsche
2025-12-18 22:01:18 +01:00

51 lines
1.2 KiB
PHP

<?php
namespace App\Http\Controllers;
use App\Services\NotificationService;
use Illuminate\Http\Request;
use Inertia\Inertia;
class NotificationController extends Controller
{
public function __construct(private NotificationService $notificationService) {}
/**
* Display a listing of the resource.
*/
public function index(Request $request)
{
$notifications = $this->notificationService->notifications($request->all());
return Inertia::render('notification/index', compact('notifications'));
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
$notification = $this->notificationService->markAsRead($id);
return Inertia::render('notification/show', compact('notification'));
}
/**
* Mark all notifications as read.
*/
public function markAllAsRead()
{
$this->notificationService->markAllAsRead();
return redirect()->back()->with('success', 'Alle Benachrichtigungen wurden als gelesen markiert');
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}