first&last

This commit is contained in:
sbb45
2026-03-20 15:47:17 +05:00
commit d6441abdd2
230 changed files with 20367 additions and 0 deletions
@@ -0,0 +1,37 @@
<?php
namespace App\Livewire\Notifications;
use Livewire\Attributes\Layout;
use Livewire\Component;
use Livewire\WithPagination;
#[Layout('layouts.app')]
class NotificationsPage extends Component
{
use WithPagination;
public function markAllAsRead(): void
{
auth()->user()?->unreadNotifications->markAsRead();
session()->flash('success', 'Все уведомления помечены как прочитанные.');
}
public function markAsRead(string $id): void
{
$notification = auth()->user()?->notifications()->findOrFail($id);
$notification->markAsRead();
}
public function render()
{
$notifications = auth()->user()
?->notifications()
->latest()
->paginate(15);
return view('livewire.notifications.notifications-page', [
'notifications' => $notifications,
])->title('Уведомления');
}
}