JSON_UNESCAPED_SLASHES

This commit is contained in:
HolgerHatGarKeineNode
2023-02-08 16:36:58 +01:00
parent e7dca50d95
commit 45140f84a1

View File

@@ -50,36 +50,38 @@ Route::middleware([])
]); ]);
}); });
Route::get('btc-map-communities', function () { Route::get('btc-map-communities', function () {
return \App\Models\Meetup::query() return response()->json(\App\Models\Meetup::query()
->with([ ->with([
'city.country', 'city.country',
]) ])
->where('community', '=', 'einundzwanzig') // ->where('community', '=', 'einundzwanzig')
->whereHas('city', // ->whereHas('city',
fn($query) => $query // fn($query) => $query
->whereNotNull('cities.simplified_geojson') // ->whereNotNull('cities.simplified_geojson')
->whereNotNull('cities.population') // ->whereNotNull('cities.population')
->whereNotNull('cities.population_date') // ->whereNotNull('cities.population_date')
) // )
->get() ->get()
->map(fn($meetup) => [ ->map(fn($meetup) => [
'id' => $meetup->slug, 'id' => $meetup->slug,
'tags' => [ 'tags' => [
'type' => 'community', 'type' => 'community',
'name' => $meetup->name, 'name' => $meetup->name,
'continent' => 'europe', 'continent' => 'europe',
'icon:square' => $meetup->getFirstMediaUrl('logo'), 'icon:square' => $meetup->getFirstMediaUrl('logo'),
'contact:email' => null, 'contact:email' => null,
'contact:twitter' => 'https://twitter.com/'.$meetup->twitter_username, 'contact:twitter' => 'https://twitter.com/'.$meetup->twitter_username,
'contact:website' => $meetup->webpage, 'contact:website' => $meetup->webpage,
'tips:lightning_address' => null, 'tips:lightning_address' => null,
'organization' => 'einundzwanzig', 'organization' => 'einundzwanzig',
'language' => $meetup->city->country->language_codes[0], 'language' => $meetup->city->country->language_codes[0],
'geo_json' => $meetup->city->simplified_geojson, 'geo_json' => $meetup->city->simplified_geojson,
'population' => $meetup->city->population, 'population' => $meetup->city->population,
'population:date' => $meetup->city->population_date, 'population:date' => $meetup->city->population_date,
], ],
]); ])
->toArray(), 200,
['Content-Type' => 'application/json;charset=UTF-8', 'Charset' => 'utf-8'], JSON_UNESCAPED_SLASHES);
}); });
}); });