mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-19 13:20:16 +00:00
🛠️ Add German portal domain and refactor URL handling for Nostr publishing
- Introduce `portal.einundzwanzig.space` with locale settings in `DomainMiddleware`. - Replace verbose if‑chain in `NostrTrait::getUrl()` with a concise match expression. - Add `DOMAIN_MAP` constant to `PublishUnpublishedItems` and force URL generation to use the correct domain per country. - Update command flow: set domain before configuring timezone/locale.
This commit is contained in:
@@ -85,17 +85,16 @@ trait NostrTrait
|
||||
|
||||
private function getUrl(Model $model, string $countryCode): string
|
||||
{
|
||||
if ($model instanceof Course) {
|
||||
return route('courses.landingpage', ['country' => $countryCode, 'course' => $model]);
|
||||
} elseif ($model instanceof CourseEvent) {
|
||||
return route('courses.landingpage', ['country' => $countryCode, 'course' => $model->course]);
|
||||
} elseif ($model instanceof Meetup) {
|
||||
return route('meetups.landingpage', ['country' => $countryCode, 'meetup' => $model]);
|
||||
} elseif ($model instanceof MeetupEvent) {
|
||||
return route('meetups.landingpage-event',
|
||||
['country' => $countryCode, 'meetup' => $model->meetup, 'event' => $model]);
|
||||
}
|
||||
|
||||
return '';
|
||||
return match (true) {
|
||||
$model instanceof Course => url()->route('courses.landingpage',
|
||||
['country' => $countryCode, 'course' => $model]),
|
||||
$model instanceof CourseEvent => url()->route('courses.landingpage',
|
||||
['country' => $countryCode, 'course' => $model->course]),
|
||||
$model instanceof Meetup => url()->route('meetups.landingpage',
|
||||
['country' => $countryCode, 'meetup' => $model]),
|
||||
$model instanceof MeetupEvent => url()->route('meetups.landingpage-event',
|
||||
['country' => $countryCode, 'meetup' => $model->meetup, 'event' => $model]),
|
||||
default => '',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user