mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-15 12:16:47 +00:00
✨ Add SEO support with configuration and traits
- Introduced `config/seo.php` to centralize SEO settings. - Implemented `SeoTrait` for dynamic SEO management. - Added `SeoDataAttribute` to set SEO metadata at the class level. - Updated various views to integrate dynamic SEO handling. - Included fallback settings for titles, descriptions, images, and more.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
use App\Models\LoginKey;
|
||||
use App\Models\User;
|
||||
use App\Notifications\ModelCreatedNotification;
|
||||
use App\Traits\SeoTrait;
|
||||
use Illuminate\Auth\Events\Lockout;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
@@ -20,6 +21,8 @@ use eza\lnurl;
|
||||
|
||||
new #[Layout('components.layouts.auth')]
|
||||
class extends Component {
|
||||
use SeoTrait;
|
||||
|
||||
#[Validate('required|string|email')]
|
||||
public string $email = '';
|
||||
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
|
||||
use App\Models\Meetup;
|
||||
use App\Models\MeetupEvent;
|
||||
use App\Traits\SeoTrait;
|
||||
use Livewire\Volt\Component;
|
||||
use Flux\Flux;
|
||||
|
||||
new class extends Component {
|
||||
use SeoTrait;
|
||||
|
||||
public $selectedMeetupId = null;
|
||||
|
||||
public $country = 'de';
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
<?php
|
||||
|
||||
use App\Attributes\SeoDataAttribute;
|
||||
use App\Models\Meetup;
|
||||
use App\Traits\SeoTrait;
|
||||
use Livewire\Volt\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
new class extends Component {
|
||||
new
|
||||
#[SeoDataAttribute(key: 'meetups_index')]
|
||||
class extends Component {
|
||||
use WithPagination;
|
||||
use SeoTrait;
|
||||
|
||||
public $country = 'de';
|
||||
public $search = '';
|
||||
@@ -20,10 +25,11 @@ new class extends Component {
|
||||
return [
|
||||
'meetups' => Meetup::with(['city.country', 'createdBy'])
|
||||
->withExists([
|
||||
'meetupEvents as has_future_events' => fn($query) => $query->where('start', '>=', now())
|
||||
'meetupEvents as has_future_events' => fn($query) => $query->where('start', '>=', now()),
|
||||
])
|
||||
->leftJoin('meetup_events', function ($join) {
|
||||
$join->on('meetups.id', '=', 'meetup_events.meetup_id')
|
||||
$join
|
||||
->on('meetups.id', '=', 'meetup_events.meetup_id')
|
||||
->where('meetup_events.start', '>=', now());
|
||||
})
|
||||
->selectRaw('meetups.*, MIN(meetup_events.start) as next_event_start')
|
||||
@@ -43,14 +49,16 @@ new class extends Component {
|
||||
<div class="flex items-center justify-between flex-col md:flex-row mb-6">
|
||||
<flux:heading size="xl">{{ __('Meetups') }}</flux:heading>
|
||||
<div class="flex flex-col md:flex-row items-center gap-4">
|
||||
<flux:button class="cursor-pointer" x-copy-to-clipboard="'{{ route('ics') }}'" icon="calendar-date-range">{{ __('Kalender-Stream-URL kopieren') }}</flux:button>
|
||||
<flux:button class="cursor-pointer" x-copy-to-clipboard="'{{ route('ics') }}'"
|
||||
icon="calendar-date-range">{{ __('Kalender-Stream-URL kopieren') }}</flux:button>
|
||||
<flux:input
|
||||
wire:model.live="search"
|
||||
:placeholder="__('Suche nach Meetups...')"
|
||||
clearable
|
||||
/>
|
||||
@auth
|
||||
<flux:button class="cursor-pointer" :href="route_with_country('meetups.create')" icon="plus" variant="primary">
|
||||
<flux:button class="cursor-pointer" :href="route_with_country('meetups.create')" icon="plus"
|
||||
variant="primary">
|
||||
{{ __('Meetup erstellen') }}
|
||||
</flux:button>
|
||||
@endauth
|
||||
@@ -70,9 +78,10 @@ new class extends Component {
|
||||
@foreach ($meetups as $meetup)
|
||||
<flux:table.row :key="$meetup->id">
|
||||
<flux:table.cell variant="strong" class="flex items-center gap-3">
|
||||
<flux:avatar
|
||||
class="[:where(&)]:size-24 [:where(&)]:text-base" size="xl"
|
||||
:href="route('meetups.landingpage', ['meetup' => $meetup, 'country' => $country])" src="{{ $meetup->getFirstMedia('logo') ? $meetup->getFirstMediaUrl('logo', 'thumb') : asset('android-chrome-512x512.png') }}"/>
|
||||
<flux:avatar
|
||||
class="[:where(&)]:size-24 [:where(&)]:text-base" size="xl"
|
||||
:href="route('meetups.landingpage', ['meetup' => $meetup, 'country' => $country])"
|
||||
src="{{ $meetup->getFirstMedia('logo') ? $meetup->getFirstMediaUrl('logo', 'thumb') : asset('android-chrome-512x512.png') }}"/>
|
||||
<div>
|
||||
@if($meetup->city)
|
||||
<a href="{{ route('meetups.landingpage', ['meetup' => $meetup, 'country' => $country]) }}">
|
||||
@@ -107,12 +116,14 @@ new class extends Component {
|
||||
<flux:table.cell>
|
||||
<div class="flex gap-2">
|
||||
@if($meetup->telegram_link)
|
||||
<flux:link :href="$meetup->telegram_link" external variant="subtle" title="{{ __('Telegram') }}">
|
||||
<flux:link :href="$meetup->telegram_link" external variant="subtle"
|
||||
title="{{ __('Telegram') }}">
|
||||
<flux:icon.paper-airplane variant="mini"/>
|
||||
</flux:link>
|
||||
@endif
|
||||
@if($meetup->webpage)
|
||||
<flux:link :href="$meetup->webpage" external variant="subtle" title="{{ __('Website') }}">
|
||||
<flux:link :href="$meetup->webpage" external variant="subtle"
|
||||
title="{{ __('Website') }}">
|
||||
<flux:icon.globe-alt variant="mini"/>
|
||||
</flux:link>
|
||||
@endif
|
||||
@@ -123,7 +134,8 @@ new class extends Component {
|
||||
</flux:link>
|
||||
@endif
|
||||
@if($meetup->matrix_group)
|
||||
<flux:link :href="$meetup->matrix_group" external variant="subtle" title="{{ __('Matrix') }}">
|
||||
<flux:link :href="$meetup->matrix_group" external variant="subtle"
|
||||
title="{{ __('Matrix') }}">
|
||||
<flux:icon.chat-bubble-left variant="mini"/>
|
||||
</flux:link>
|
||||
@endif
|
||||
@@ -134,7 +146,8 @@ new class extends Component {
|
||||
</flux:link>
|
||||
@endif
|
||||
@if($meetup->simplex)
|
||||
<flux:link :href="$meetup->simplex" external variant="subtle" title="{{ __('Simplex') }}">
|
||||
<flux:link :href="$meetup->simplex" external variant="subtle"
|
||||
title="{{ __('Simplex') }}">
|
||||
<flux:icon.chat-bubble-bottom-center-text variant="mini"/>
|
||||
</flux:link>
|
||||
@endif
|
||||
@@ -151,13 +164,15 @@ new class extends Component {
|
||||
<div>
|
||||
<flux:button
|
||||
:disabled="!$meetup->belongsToMe"
|
||||
:href="$meetup->belongsToMe ? route_with_country('meetups.edit', ['meetup' => $meetup]) : null" size="xs"
|
||||
:href="$meetup->belongsToMe ? route_with_country('meetups.edit', ['meetup' => $meetup]) : null"
|
||||
size="xs"
|
||||
variant="filled" icon="pencil">
|
||||
{{ __('Bearbeiten') }}
|
||||
</flux:button>
|
||||
</div>
|
||||
<div>
|
||||
<flux:button :href="route_with_country('meetups.events.create', ['meetup' => $meetup])" size="xs" variant="filled" icon="calendar">
|
||||
<flux:button :href="route_with_country('meetups.events.create', ['meetup' => $meetup])"
|
||||
size="xs" variant="filled" icon="calendar">
|
||||
{{ __('Neues Event erstellen') }}
|
||||
</flux:button>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
<?php
|
||||
|
||||
use App\Traits\SeoTrait;
|
||||
use Livewire\Volt\Component;
|
||||
use Livewire\Attributes\Layout;
|
||||
|
||||
new #[Layout('components.layouts.auth')]
|
||||
class extends Component {
|
||||
use SeoTrait;
|
||||
|
||||
public function goToMeetups(): void
|
||||
{
|
||||
$this->redirect(route_with_country('meetups.index'), navigate: true);
|
||||
@@ -23,7 +26,8 @@ class extends Component {
|
||||
<div class="flex justify-center">
|
||||
<a href="/" class="group flex items-center gap-3">
|
||||
<div>
|
||||
<flux:avatar class="[:where(&)]:size-32 [:where(&)]:text-base" size="xl" src="{{ asset('img/einundzwanzig-square.svg') }}" />
|
||||
<flux:avatar class="[:where(&)]:size-32 [:where(&)]:text-base" size="xl"
|
||||
src="{{ asset('img/einundzwanzig-square.svg') }}"/>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@@ -53,7 +57,8 @@ class extends Component {
|
||||
{{ __('Kartenansicht öffnen') }}
|
||||
</flux:button>
|
||||
|
||||
<flux:button :href="route('dashboard', ['country' => 'de'])" class="cursor-pointer w-full" icon="arrow-right-start-on-rectangle">
|
||||
<flux:button :href="route('dashboard', ['country' => 'de'])" class="cursor-pointer w-full"
|
||||
icon="arrow-right-start-on-rectangle">
|
||||
{{ __('Login') }}
|
||||
</flux:button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user