This commit is contained in:
2024-11-27 23:19:09 +05:00
parent dadb3e2508
commit c362c3aacd

View File

@@ -9,13 +9,14 @@ class AlertController extends Controller
*/ */
public function index() public function index()
{ {
return auth()->id();
$alerstQuery = auth()->user()->alerts()->whereNull('seen_at'); $alerstQuery = auth()->user()->alerts()->whereNull('seen_at');
$alerts = $alerstQuery->get(); $alerts = $alerstQuery->get();
$alerstQuery->update([ // $alerstQuery->update([
'seen_at' => now(), // 'seen_at' => now(),
]); // ]);
return response()->json($this->format($alerts)); return response()->json($this->format($alerts));
} }