F
Filament9mo 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
@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
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server