Security hardening: fixed 13 vulnerabilities, added AI-powered SupportController (Gemini), and stabilized Flutter Complaint logic

This commit is contained in:
Hamza-Ayed
2026-04-24 22:55:56 +03:00
parent cc85fe1815
commit 540c5cc7ab
11 changed files with 292 additions and 71 deletions

View File

@@ -49,8 +49,12 @@ class NotificationController extends Controller
$userType = $request->attributes->get('_jwt_user_type');
$table = $userType === 'driver' ? 'notificationCaptain' : 'notifications';
$userId = $request->attributes->get('_jwt_user_id');
$userField = $userType === 'driver' ? 'driverID' : 'passenger_id';
DB::connection('primary')->table($table)
->where('id', $id)
->where($userField, $userId)
->update(['isShown' => 'true']);
return response()->json(['status' => 'success']);
@@ -82,9 +86,10 @@ class NotificationController extends Controller
'affected' => $affected
]);
} catch (\Throwable $e) {
\Log::error('NotificationController Update Error: ' . $e->getMessage());
return response()->json([
'status' => 'failure',
'message' => 'Internal error: ' . $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine()
'message' => 'Internal server error occurred'
], 500);
}
}