fix: Use slug for Document route model binding
- Add getRouteKeyName() to return 'slug' for Document model - Add resolveRouteBinding() to support both slug and ID lookups - Update QuickSwitcher to use slug instead of ID - Update quick-switcher blade to use slug in routes This ensures URLs use readable slugs (e.g., /documents/home) while maintaining backwards compatibility with ID-based URLs
This commit is contained in:
@@ -68,7 +68,7 @@ class="w-full pl-10 pr-4 py-3 border-0 focus:ring-0 text-lg"
|
||||
@foreach($this->results as $index => $result)
|
||||
<li>
|
||||
<a
|
||||
href="{{ route('documents.show', $result['id']) }}"
|
||||
href="{{ route('documents.show', $result['slug']) }}"
|
||||
class="block px-4 py-3 hover:bg-gray-50 transition {{ $index === $selectedIndex ? 'bg-indigo-50' : '' }}"
|
||||
wire:navigate
|
||||
@click="open = false"
|
||||
|
||||
Reference in New Issue
Block a user