mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
Apply Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions. You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root. For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
This commit is contained in:
committed by
HolgerHatGarKeineNode
parent
a15ca4a2bc
commit
5776b01d15
@@ -36,18 +36,18 @@ Route::middleware([])
|
||||
'city',
|
||||
])
|
||||
->get()
|
||||
->map(fn($meetup) => [
|
||||
'name' => $meetup->name,
|
||||
'url' => $meetup->telegram_link ?? $meetup->webpage,
|
||||
'top' => $meetup->github_data['top'] ?? null,
|
||||
'left' => $meetup->github_data['left'] ?? null,
|
||||
'country' => str($meetup->city->country->code)->upper(),
|
||||
'state' => $meetup->github_data['state'] ?? null,
|
||||
'city' => $meetup->city->name,
|
||||
'longitude' => (float) $meetup->city->longitude,
|
||||
'latitude' => (float) $meetup->city->latitude,
|
||||
->map(fn ($meetup) => [
|
||||
'name' => $meetup->name,
|
||||
'url' => $meetup->telegram_link ?? $meetup->webpage,
|
||||
'top' => $meetup->github_data['top'] ?? null,
|
||||
'left' => $meetup->github_data['left'] ?? null,
|
||||
'country' => str($meetup->city->country->code)->upper(),
|
||||
'state' => $meetup->github_data['state'] ?? null,
|
||||
'city' => $meetup->city->name,
|
||||
'longitude' => (float) $meetup->city->longitude,
|
||||
'latitude' => (float) $meetup->city->latitude,
|
||||
'twitter_username' => $meetup->twitter_username,
|
||||
'website' => $meetup->webpage,
|
||||
'website' => $meetup->webpage,
|
||||
]);
|
||||
});
|
||||
Route::get('btc-map-communities', function () {
|
||||
@@ -58,29 +58,29 @@ Route::middleware([])
|
||||
])
|
||||
->where('community', '=', 'einundzwanzig')
|
||||
->when(app()->environment('production'),
|
||||
fn($query) => $query->whereHas('city',
|
||||
fn($query) => $query
|
||||
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,
|
||||
->map(fn ($meetup) => [
|
||||
'id' => $meetup->slug,
|
||||
'tags' => [
|
||||
'type' => 'community',
|
||||
'name' => $meetup->name,
|
||||
'continent' => 'europe',
|
||||
'icon:square' => $meetup->logoSquare,
|
||||
'type' => 'community',
|
||||
'name' => $meetup->name,
|
||||
'continent' => 'europe',
|
||||
'icon:square' => $meetup->logoSquare,
|
||||
//'contact:email' => null,
|
||||
'contact:twitter' => 'https://twitter.com/'.$meetup->twitter_username,
|
||||
'contact:website' => $meetup->webpage,
|
||||
'contact:nostr' => $meetup->nostr,
|
||||
'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,
|
||||
'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,
|
||||
],
|
||||
])
|
||||
@@ -89,33 +89,33 @@ Route::middleware([])
|
||||
});
|
||||
});
|
||||
|
||||
Route::get('/lnurl-auth-callback', function (\Illuminate\Http\Request $request) {
|
||||
Route::get('/lnurl-auth-callback', function (Request $request) {
|
||||
if (lnurl\auth($request->k1, $request->sig, $request->key)) {
|
||||
// find User by $wallet_public_key
|
||||
$user = User::query()
|
||||
->whereBlind('public_key', 'public_key_index', $request->key)
|
||||
->first();
|
||||
if (!$user) {
|
||||
if (! $user) {
|
||||
// create User
|
||||
$user = User::create([
|
||||
'public_key' => $request->key,
|
||||
'public_key' => $request->key,
|
||||
'is_lecturer' => true,
|
||||
'name' => $request->key,
|
||||
'email' => str($request->key)->substr(-12).'@portal.einundzwanzig.space'
|
||||
'name' => $request->key,
|
||||
'email' => str($request->key)->substr(-12).'@portal.einundzwanzig.space',
|
||||
]);
|
||||
$user->ownedTeams()
|
||||
->save(Team::forceCreate([
|
||||
'user_id' => $user->id,
|
||||
'name' => $request->key."'s Team",
|
||||
'user_id' => $user->id,
|
||||
'name' => $request->key."'s Team",
|
||||
'personal_team' => true,
|
||||
]));
|
||||
}
|
||||
// check if $k1 is in the database, if not, add it
|
||||
$loginKey = LoginKey::where('k1', $request->k1)
|
||||
->first();
|
||||
if (!$loginKey) {
|
||||
if (! $loginKey) {
|
||||
LoginKey::create([
|
||||
'k1' => $request->k1,
|
||||
'k1' => $request->k1,
|
||||
'user_id' => $user->id,
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user