๐ŸŒด Palm Debugger Exception

Error: Cannot access offset of type string on string

๐Ÿ“ Error Location

src/views/home/landing_city.palm.php:12

๐Ÿ“ Code Context

5use App\Core\App;
6
7// Load geo data to find city-specific keywords/region
8$geoPath = dirname(__DIR__, 3) . '/public/geo.json';
9$geoData = file_exists($geoPath) ? json_decode(file_get_contents($geoPath), true) : [];
10$cityMeta = null;
11foreach($geoData as $g) {
โ†’ 12 if ($g['slug'] === $citySlug) {
13 $cityMeta = $g;
14 break;
15 }
16}
17
18$cityName = $cityMeta['city'] ?? $city;
19$regionName = $cityMeta['region'] ?? 'Pakistan';

๐Ÿ“š Stack Trace

  1. app/Palm/Route.php:740
    require()
  2. src/routes/web.php:1425
    Frontend\Palm\Route::render()
  3. middlewares/VisitorCounterMiddleware.php:103
    {closure}()
  4. app/Palm/Route.php:377
    App\Middlewares\VisitorCounterMiddleware::handle()
  5. app/Palm/Route.php:669
    Frontend\Palm\Route::Frontend\Palm\{closure}()
  6. index.php:294
    Frontend\Palm\Route::dispatch()