lk.zachem.info/app/Modules/Notice/Http/Livewire/UserNotices.php
2025-05-23 19:37:45 +08:00

24 lines
543 B
PHP

<?php
namespace Modules\Notice\Http\Livewire;
use Livewire\Component;
use Illuminate\Notifications\DatabaseNotification;
class UserNotices extends Component
{
public function read(DatabaseNotification $notice)
{
$notice->markAsRead();
}
public function render()
{
$currentDate = date("Y-m-d");
$startDate = date("Y-m-d", strtotime($currentDate . " -2 months"));
return view('notice::user-notifications', [
'notifications' => auth()->user()->notifications
]);
}
}