© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
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
getRelationships
view this will generate an error:
DocumentResource::getUrl('view', ['record' => $item->model->id]);
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
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Open another form modal from a form modal
FilamentFFilament / ❓┊help
10mo ago
ViewColumn does not open modal with Modal Blade component
FilamentFFilament / ❓┊help
3y ago
Custom field Open Modal Form
FilamentFFilament / ❓┊help
3y ago
Refresh Modal form on Custom component
FilamentFFilament / ❓┊help
6mo ago