@php $link = $link ?? null; $selectedTagIds = old('tags', $link?->tags?->pluck('id')->toArray() ?? []); $selectedTagNames = old('tags', $link?->tags?->map(fn ($t) => ['id' => $t->id, 'name' => $t->name, 'color' => $t->color])->values()->toArray() ?? []); @endphp
project_id ?? $defaultProjectId ?? '') }}", folderId: "{{ old('folder_id', $link?->folder_id ?? $defaultFolderId ?? '') }}", foldersByProject: @json($foldersByProject), get folders() { return this.foldersByProject[String(this.projectId)] ?? [] }, duplicateInfo: null, checkingDuplicate: false, async checkDuplicate(url) { if (!url || !url.startsWith("http")) { this.duplicateInfo = null; return; } this.checkingDuplicate = true; try { const r = await fetch("{{ route('links.check-duplicate') }}?url=" + encodeURIComponent(url), { headers: { "X-Requested-With": "XMLHttpRequest" } }); const data = await r.json(); this.duplicateInfo = data.exists ? data.link : null; } catch(e) { this.duplicateInfo = null; } this.checkingDuplicate = false; } }' class="grid gap-5 sm:grid-cols-2"> {{-- URL --}}
URL * @if ($link) {{-- En edición la URL no cambia --}}

La URL no se puede modificar una vez guardada.

@else {{-- Aviso de duplicado --}}
Ya tienes este enlace:
Verificando duplicado…
@endif
{{-- Título (opcional) --}}
Título (opcional — se rellena automáticamente)
{{-- Proyecto --}}
Proyecto * @foreach ($projects as $project) @endforeach
{{-- Carpeta (dependiente del proyecto) --}}
Carpeta *

Este proyecto no tiene carpetas. Crea una primero.

{{-- Categoría --}}
Categoría @foreach ($categories as $cat) @endforeach
{{-- Etiquetas typeahead --}}
i !== id); this.selectedNames = this.selectedNames.filter(t => t.id !== id); } }'> Etiquetas
{{-- Nota personal --}}
Nota personal
@if ($link) Cancelar @else Cancelar @endif Guardar