© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
14 replies
Damien

How do I correctly create a link to a record from another view?

I has various pages within the app I am building where I am displaying a list of items based on data being passed in.

what I haven't been able to find in the docs yet though is how I can correctly link to one of the items being rendered so that it either navigates to the record view or opens up the view modal.

Here is some example code with the todo comment being where I would like to action the link from

@foreach($this->data['products'] as $product)
    <div class="flex items-center justify-between pt-4">
        <div class="space-y-2">
            <p class="font-semibold">{{ $product['name'] }}</p>
            <p class="flex items-center text-gray-500">
                <x-heroicon-s-calendar class="w-5 h-5 mr-1"/>
                Updated: {{ date('d-m-Y H:i', strtotime($product['updated_at'] ?? $product['created_at'])) }}
            </p>
        </div>
        <div>
            {{-- TODO: Link to view record or view modal --}}
            <x-filament::button>
                Edit Product
            </x-filament::button>
        </div>
    </div>
@endforeach
@foreach($this->data['products'] as $product)
    <div class="flex items-center justify-between pt-4">
        <div class="space-y-2">
            <p class="font-semibold">{{ $product['name'] }}</p>
            <p class="flex items-center text-gray-500">
                <x-heroicon-s-calendar class="w-5 h-5 mr-1"/>
                Updated: {{ date('d-m-Y H:i', strtotime($product['updated_at'] ?? $product['created_at'])) }}
            </p>
        </div>
        <div>
            {{-- TODO: Link to view record or view modal --}}
            <x-filament::button>
                Edit Product
            </x-filament::button>
        </div>
    </div>
@endforeach


Apologies if this is an easy find, I struggled to do so and I couldn't find a similar thread in the forumn already.
Solution
Turns out, it was in the docs all along and I was being stupid! I think I need this:

se App\Filament\Resources\CustomerResource;
<x-filament::button tag="a" href="{{
    \App\Filament\Resources\ProjectResource::getUrl(parameters: [
        'action' => \Filament\Actions\CreateAction::getDefaultName(),
    ])
}}">
    New Project
</x-filament::button>
se App\Filament\Resources\CustomerResource;
<x-filament::button tag="a" href="{{
    \App\Filament\Resources\ProjectResource::getUrl(parameters: [
        'action' => \Filament\Actions\CreateAction::getDefaultName(),
    ])
}}">
    New Project
</x-filament::button>


Will come back and confirm.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to create a resource record from another resource?
FilamentFFilament / ❓┊help
3y ago
How do I correctly pass data to custom view ?
FilamentFFilament / ❓┊help
9mo ago
How to create pdf from a ViewResource Page
FilamentFFilament / ❓┊help
2y ago
How do I create an Infolist Link?
FilamentFFilament / ❓┊help
3y ago