Implement SeoTrait across components for improved SEO integration.

This commit is contained in:
HolgerHatGarKeineNode
2025-11-22 22:16:55 +01:00
parent 25843db5a9
commit d359dd56b0
31 changed files with 202 additions and 73 deletions

View File

@@ -2,9 +2,12 @@
use App\Models\City;
use App\Models\Country;
use App\Traits\SeoTrait;
use Livewire\Volt\Component;
new class extends Component {
use SeoTrait;
public string $name = '';
public ?int $country_id = null;
public float $latitude = 0;
@@ -51,7 +54,7 @@ new class extends Component {
<flux:legend>{{ __('Basic Information') }}</flux:legend>
<div class="space-y-6">
<flux:input label="{{ __('Name') }}" wire:model="name" required />
<flux:input label="{{ __('Name') }}" wire:model="name" required/>
<flux:select label="{{ __('Country') }}" wire:model="country_id" required>
<option value="">{{ __('Select a country') }}</option>
@@ -66,8 +69,8 @@ new class extends Component {
<flux:legend>{{ __('Coordinates') }}</flux:legend>
<div class="grid grid-cols-2 gap-x-4 gap-y-6">
<flux:input label="{{ __('Latitude') }}" type="number" step="any" wire:model="latitude" required />
<flux:input label="{{ __('Longitude') }}" type="number" step="any" wire:model="longitude" required />
<flux:input label="{{ __('Latitude') }}" type="number" step="any" wire:model="latitude" required/>
<flux:input label="{{ __('Longitude') }}" type="number" step="any" wire:model="longitude" required/>
</div>
</flux:fieldset>
@@ -75,8 +78,8 @@ new class extends Component {
<flux:legend>{{ __('Demographics') }}</flux:legend>
<div class="grid grid-cols-2 gap-x-4 gap-y-6">
<flux:input label="{{ __('Population') }}" type="number" wire:model="population" />
<flux:input label="{{ __('Population Date') }}" wire:model="population_date" placeholder="e.g. 2024" />
<flux:input label="{{ __('Population') }}" type="number" wire:model="population"/>
<flux:input label="{{ __('Population Date') }}" wire:model="population_date" placeholder="e.g. 2024"/>
</div>
</flux:fieldset>

View File

@@ -2,9 +2,12 @@
use App\Models\City;
use App\Models\Country;
use App\Traits\SeoTrait;
use Livewire\Volt\Component;
new class extends Component {
use SeoTrait;
public City $city;
public string $name = '';
public ?int $country_id = null;
@@ -62,7 +65,7 @@ new class extends Component {
<flux:legend>{{ __('Basic Information') }}</flux:legend>
<div class="space-y-6">
<flux:input label="{{ __('Name') }}" wire:model="name" required />
<flux:input label="{{ __('Name') }}" wire:model="name" required/>
<flux:select label="{{ __('Country') }}" wire:model="country_id" required>
<option value="">{{ __('Select a country') }}</option>
@@ -77,8 +80,8 @@ new class extends Component {
<flux:legend>{{ __('Coordinates') }}</flux:legend>
<div class="grid grid-cols-2 gap-x-4 gap-y-6">
<flux:input label="{{ __('Latitude') }}" type="number" step="any" wire:model="latitude" required />
<flux:input label="{{ __('Longitude') }}" type="number" step="any" wire:model="longitude" required />
<flux:input label="{{ __('Latitude') }}" type="number" step="any" wire:model="latitude" required/>
<flux:input label="{{ __('Longitude') }}" type="number" step="any" wire:model="longitude" required/>
</div>
</flux:fieldset>
@@ -86,8 +89,8 @@ new class extends Component {
<flux:legend>{{ __('Demographics') }}</flux:legend>
<div class="grid grid-cols-2 gap-x-4 gap-y-6">
<flux:input label="{{ __('Population') }}" type="number" wire:model="population" />
<flux:input label="{{ __('Population Date') }}" wire:model="population_date" placeholder="e.g. 2024" />
<flux:input label="{{ __('Population') }}" type="number" wire:model="population"/>
<flux:input label="{{ __('Population Date') }}" wire:model="population_date" placeholder="e.g. 2024"/>
</div>
</flux:fieldset>

View File

@@ -1,11 +1,13 @@
<?php
use App\Models\City;
use App\Traits\SeoTrait;
use Livewire\Volt\Component;
use Livewire\WithPagination;
new class extends Component {
use WithPagination;
use SeoTrait;
public $country = 'de';
public $search = '';
@@ -38,7 +40,8 @@ new class extends Component {
clearable
/>
@auth
<flux:button class="cursor-pointer" :href="route_with_country('cities.create')" icon="plus" variant="primary">
<flux:button class="cursor-pointer" :href="route_with_country('cities.create')" icon="plus"
variant="primary">
{{ __('Create City') }}
</flux:button>
@endauth
@@ -81,7 +84,9 @@ new class extends Component {
<flux:table.cell>
<div class="flex gap-2">
@auth
<flux:button size="xs" :href="route('cities.edit',['city' => $city, 'country' => $country])" icon="pencil">
<flux:button size="xs"
:href="route('cities.edit',['city' => $city, 'country' => $country])"
icon="pencil">
{{ __('Edit') }}
</flux:button>
@endauth