getCollection()->transform(function ($item) { $geojson = DB::selectOne('SELECT ST_AsGeoJSON(ST_Transform(geom, 4326)) as geojson FROM master.irrigations_section WHERE id = ?', [$item->id])->geojson; $item->geojson = $geojson; return $item; }); return SectionResource::collection($sections); } }