# Login Activity Tracking Update

## Summary
Added login activity tracking for both web and API authentication flows in LendCore.

## What was implemented
- Created `login_activities` table to store login metadata.
- Extended web login flow to record:
  - `login_type` (`web`)
  - `device_type` (browser, android, iphone)
  - `phone_type` (optional)
  - `ip_address`
  - `user_agent`
  - `status` (`success` or `failed`)
- Extended API login flow to accept and record:
  - `login_type` (`web` or `app`)
  - `device_type`
  - `phone_type`
  - `ip_address`
  - `user_agent`
  - `status`

## Files added
- `database/migrations/2026_04_27_000000_create_login_activities_table.php`
- `app/Models/LoginActivity.php`

## Files updated
- `app/Http/Controllers/Web/UserAuthController.php`
- `routes/api.php`
- `app/Models/User.php`

## Migration
- Ran `php artisan migrate`
- Created `login_activities` table successfully

## Notes
- This update supports capturing both web and mobile app login context.
- API clients should pass `login_type`, `device_type`, and `phone_type` when available.
- Future improvement: add an admin view or API endpoint to review login activity records.
