service->load('createdBy'); $this->country = request()->route('country', config('app.domain_country')); } public function delete(): void { // Only allow deletion if user is the creator if (auth()->id() === $this->service->created_by) { $this->service->delete(); session()->flash('status', __('Service erfolgreich gelöscht!')); redirect()->route('services.index', ['country' => $this->country]); } else { abort(403); } } public function with(): array { return [ 'service' => $this->service, ]; } }; ?>
{{ $service->name }} @auth @if(auth()->id() === $service->created_by)
{{ __('Bearbeiten') }} {{ __('Löschen') }}
@endif @endauth
@if($service->type) {{ $service->type->label() }} @endif
@if($service->intro) {{ __('Beschreibung') }}
{{ $service->intro }}
@endif @if($service->contact) {{ __('Kontakt') }}
{{ $service->contact }}
@endif
{{ __('Zugriff') }}
@if($service->url_clearnet) Clearnet @endif @if($service->url_onion) Onion / Tor @endif @if($service->url_i2p) I2P @endif @if($service->url_pkdns) pkdns @endif
{{ __('Informationen') }}
{{ __('Erstellt von') }}
@if($service->createdBy)
{{ $service->createdBy->name }}
@else {{ __('Anonymous') }} @endif
{{ __('Erstellt am') }}
{{ $service->created_at->format('d.m.Y H:i') }}
@if($service->created_at->ne($service->updated_at))
{{ __('Zuletzt aktualisiert') }}
{{ $service->updated_at->format('d.m.Y H:i') }}
@endif
{{ __('Zurück zur Übersicht') }}
{{ __('Service löschen?') }} {{ __('Möchten Sie den Service wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.') }}
{{ __('Abbrechen') }} {{ __('Löschen') }}