mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
add logo to meetup events api
This commit is contained in:
134
routes/api.php
134
routes/api.php
@@ -69,7 +69,8 @@ Route::middleware([])
|
||||
])
|
||||
->orderByDesc('id')
|
||||
->get()
|
||||
->map(fn($item) => [
|
||||
->map(fn($item)
|
||||
=> [
|
||||
'id' => $item->id,
|
||||
'name' => $item->name,
|
||||
'link' => strtok($item->value, "?"),
|
||||
@@ -85,9 +86,13 @@ Route::middleware([])
|
||||
'media',
|
||||
])
|
||||
->get()
|
||||
->map(fn($meetup) => [
|
||||
->map(fn($meetup)
|
||||
=> [
|
||||
'name' => $meetup->name,
|
||||
'portalLink' => url()->route('meetup.landing', ['country' => $meetup->city->country, 'meetup' => $meetup]),
|
||||
'portalLink' => url()->route(
|
||||
'meetup.landing',
|
||||
['country' => $meetup->city->country, 'meetup' => $meetup],
|
||||
),
|
||||
'url' => $meetup->telegram_link ?? $meetup->webpage,
|
||||
'top' => $meetup->github_data['top'] ?? null,
|
||||
'left' => $meetup->github_data['left'] ?? null,
|
||||
@@ -112,21 +117,32 @@ Route::middleware([])
|
||||
}
|
||||
$events = \App\Models\MeetupEvent::query()
|
||||
->with([
|
||||
'meetup.city.country'
|
||||
'meetup.city.country',
|
||||
'meetup.media',
|
||||
])
|
||||
->when($date, fn($query) => $query
|
||||
->where('start', '>=', $date)
|
||||
->where('start', '<=', $date->copy()->endOfMonth())
|
||||
->when(
|
||||
$date,
|
||||
fn($query)
|
||||
=> $query
|
||||
->where('start', '>=', $date)
|
||||
->where('start', '<=', $date->copy()->endOfMonth()),
|
||||
)
|
||||
->get();
|
||||
|
||||
return $events->map(fn($event) => [
|
||||
return $events->map(fn($event)
|
||||
=> [
|
||||
'start' => $event->start->format('Y-m-d H:i'),
|
||||
'location' => $event->location,
|
||||
'description' => $event->description,
|
||||
'link' => $event->link,
|
||||
'meetup.name' => $event->meetup->name,
|
||||
'meetup.portalLink' => url()->route('meetup.landing', ['country' => $event->meetup->city->country, 'meetup' => $event->meetup]),
|
||||
'meetup.portalLink' => url()->route(
|
||||
'meetup.landing',
|
||||
[
|
||||
'country' => $event->meetup->city->country,
|
||||
'meetup' => $event->meetup,
|
||||
],
|
||||
),
|
||||
'meetup.url' => $event->meetup->telegram_link ?? $event->meetup->webpage,
|
||||
'meetup.country' => str($event->meetup->city->country->code)->upper(),
|
||||
'meetup.city' => $event->meetup->city->name,
|
||||
@@ -137,46 +153,57 @@ Route::middleware([])
|
||||
'meetup.simplex' => $event->meetup->simplex,
|
||||
'meetup.signal' => $event->meetup->signal,
|
||||
'meetup.nostr' => $event->meetup->nostr,
|
||||
]
|
||||
'meetup.logo' => $event->meetup->getFirstMediaUrl('logo'),
|
||||
],
|
||||
);
|
||||
});
|
||||
Route::get('btc-map-communities', function () {
|
||||
return response()->json(\App\Models\Meetup::query()
|
||||
->with([
|
||||
'media',
|
||||
'city.country',
|
||||
])
|
||||
->where('community', '=', 'einundzwanzig')
|
||||
->when(app()->environment('production'),
|
||||
fn($query) => $query->whereHas('city',
|
||||
fn($query) => $query
|
||||
->whereNotNull('cities.simplified_geojson')
|
||||
->whereNotNull('cities.population')
|
||||
->whereNotNull('cities.population_date')
|
||||
))
|
||||
->get()
|
||||
->map(fn($meetup) => [
|
||||
'id' => $meetup->slug,
|
||||
'tags' => [
|
||||
'type' => 'community',
|
||||
'name' => $meetup->name,
|
||||
'continent' => 'europe',
|
||||
'icon:square' => $meetup->logoSquare,
|
||||
//'contact:email' => null,
|
||||
'contact:twitter' => $meetup->twitter_username ? 'https://twitter.com/' . $meetup->twitter_username : null,
|
||||
'contact:website' => $meetup->webpage,
|
||||
'contact:telegram' => $meetup->telegram_link,
|
||||
'contact:nostr' => $meetup->nostr,
|
||||
//'tips:lightning_address' => null,
|
||||
'organization' => 'einundzwanzig',
|
||||
'language' => $meetup->city->country->language_codes[0] ?? 'de',
|
||||
'geo_json' => $meetup->city->simplified_geojson,
|
||||
'population' => $meetup->city->population,
|
||||
'population:date' => $meetup->city->population_date,
|
||||
],
|
||||
])
|
||||
->toArray(), 200,
|
||||
['Content-Type' => 'application/json;charset=UTF-8', 'Charset' => 'utf-8'], JSON_UNESCAPED_SLASHES);
|
||||
return response()->json(
|
||||
\App\Models\Meetup::query()
|
||||
->with([
|
||||
'media',
|
||||
'city.country',
|
||||
])
|
||||
->where('community', '=', 'einundzwanzig')
|
||||
->when(
|
||||
app()->environment('production'),
|
||||
fn($query)
|
||||
=> $query->whereHas(
|
||||
'city',
|
||||
fn($query)
|
||||
=> $query
|
||||
->whereNotNull('cities.simplified_geojson')
|
||||
->whereNotNull('cities.population')
|
||||
->whereNotNull('cities.population_date'),
|
||||
),
|
||||
)
|
||||
->get()
|
||||
->map(fn($meetup)
|
||||
=> [
|
||||
'id' => $meetup->slug,
|
||||
'tags' => [
|
||||
'type' => 'community',
|
||||
'name' => $meetup->name,
|
||||
'continent' => 'europe',
|
||||
'icon:square' => $meetup->logoSquare,
|
||||
//'contact:email' => null,
|
||||
'contact:twitter' => $meetup->twitter_username ? 'https://twitter.com/' . $meetup->twitter_username : null,
|
||||
'contact:website' => $meetup->webpage,
|
||||
'contact:telegram' => $meetup->telegram_link,
|
||||
'contact:nostr' => $meetup->nostr,
|
||||
//'tips:lightning_address' => null,
|
||||
'organization' => 'einundzwanzig',
|
||||
'language' => $meetup->city->country->language_codes[0] ?? 'de',
|
||||
'geo_json' => $meetup->city->simplified_geojson,
|
||||
'population' => $meetup->city->population,
|
||||
'population:date' => $meetup->city->population_date,
|
||||
],
|
||||
])
|
||||
->toArray(),
|
||||
200,
|
||||
['Content-Type' => 'application/json;charset=UTF-8', 'Charset' => 'utf-8'],
|
||||
JSON_UNESCAPED_SLASHES,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -210,12 +237,15 @@ Route::get('/lnurl-auth-callback', function (Request $request) {
|
||||
'wallet_id' => null,
|
||||
],
|
||||
]);
|
||||
$user->ownedTeams()
|
||||
->save(Team::forceCreate([
|
||||
'user_id' => $user->id,
|
||||
'name' => $fakeName . "'s Team",
|
||||
'personal_team' => true,
|
||||
]));
|
||||
$user
|
||||
->ownedTeams()
|
||||
->save(
|
||||
Team::forceCreate([
|
||||
'user_id' => $user->id,
|
||||
'name' => $fakeName . "'s Team",
|
||||
'personal_team' => true,
|
||||
]),
|
||||
);
|
||||
}
|
||||
// check if $k1 is in the database, if not, add it
|
||||
$loginKey = LoginKey::where('k1', $request->k1)
|
||||
|
||||
Reference in New Issue
Block a user