# 3. LocationController — `app/Http/Controllers/LocationController.php`

## Current State

Has dropdown endpoints for countries and states but **no cities-by-state endpoint** for cascading dropdowns:
- `getCountryForDropdown()` (line 171) — returns all active countries
- `getStatesForDropdown()` (line 193) — returns all active states

## Change: Add `getCitiesByState` method

Add after `getStatesForDropdown()` method (after line 197):

```php
public function getCitiesByState($stateId)
{
    $cities = Cities::where('status', 1)
        ->where('state_id', $stateId)
        ->get(['id', 'name']);
    return response()->json($cities, 200);
}
```

**Pattern:** Identical to existing `getCountryForDropdown()` and `getStatesForDropdown()` — returns a simple JSON array of `{id, name}` objects.

**Called by:** The `createEvent.js` JavaScript when the state dropdown changes — fetches cities for the selected state via AJAX `GET /location/get-cities-by-state/{stateId}`.

---

## No other changes to this file.
