FilamentF
Filament2y ago
Omid

Open URL as modal, from a custom Blade form component

Is there a way to link to a record and open its view page in a modal?

When removing the getRelationships view this will generate an error: DocumentResource::getUrl('view', ['record' => $item->model->id]);

@if($item->isDocument())
    @php
        $url = DocumentResource::getUrl('view', ['record' => $item->model->id]);
    @endphp

    <x-filament::badge tag="a" :href="$url" :color="$item->model->type->getColor()" :icon="$item->model->type->getIcon()">
        {{ $item->model->type->getLabel() }} <span class="text-xs">#{{ $item->model->id }}</span>
    </x-filament::badge>
@endif
Was this page helpful?