btc-meetups updated

This commit is contained in:
HolgerHatGarKeineNode
2023-02-08 14:18:45 +01:00
parent 80559b1bbd
commit 7d380d4ad9

View File

@@ -49,12 +49,39 @@ Route::middleware([])
'website' => $meetup->webpage, 'website' => $meetup->webpage,
]); ]);
}); });
Route::get('btc-meetups', function () {
return \App\Models\Meetup::query()
->with([
'city.country',
])
->whereHas('city', fn($query) => $query->whereNotNull('cities.simplified_geojson'))
->get()
->map(fn($meetup) => [
'id' => $meetup->slug,
'tags' => [
'type' => 'community',
'name' => $meetup->name,
'continent' => $meetup->city->country->europe,
'icon:square' => $meetup->getFirstMediaUrl('logo'),
'contact:email' => null,
'contact:twitter' => 'https://twitter.com/'.$meetup->twitter_username,
'contact:website' => $meetup->webpage,
'tips:lightning_address' => null,
'organization' => 'einundzwanzig',
'language' => $meetup->city->country->language_codes[0],
'geo_json' => $meetup->city->simplified_geojson,
'population' => $meetup->city->population,
'population:date' => $meetup->city->population_date,
],
]);
});
}); });
Route::get('/lnurl-auth-callback', function (\Illuminate\Http\Request $request) { Route::get('/lnurl-auth-callback', function (\Illuminate\Http\Request $request) {
if (lnurl\auth($request->k1, $request->sig, $request->key)) { if (lnurl\auth($request->k1, $request->sig, $request->key)) {
// find User by $wallet_public_key // find User by $wallet_public_key
$user = User::query()->whereBlind('public_key', 'public_key_index', $request->key) $user = User::query()
->whereBlind('public_key', 'public_key_index', $request->key)
->first(); ->first();
if (!$user) { if (!$user) {
// create User // create User