wip
This commit is contained in:
@@ -9,13 +9,14 @@ class AlertController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return auth()->id();
|
||||
$alerstQuery = auth()->user()->alerts()->whereNull('seen_at');
|
||||
|
||||
$alerts = $alerstQuery->get();
|
||||
|
||||
$alerstQuery->update([
|
||||
'seen_at' => now(),
|
||||
]);
|
||||
// $alerstQuery->update([
|
||||
// 'seen_at' => now(),
|
||||
// ]);
|
||||
|
||||
return response()->json($this->format($alerts));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user