© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
4 replies
Sven

Only allow to edit one record in my resource

Hey!

Is it possible to have a filament ressource but skip the view which lists all records and always navigate to the edit-route of a specific record?

I tried something like this:

// ProfileResource.php

    public static function getPages(): array
    {
        return [
            // I named it index so that it is still
            // in the navigation
            'index' => Pages\EditProfile::route('/'),
        ];
    }

// ProfileResourse/Pages/EditProfile.php
class EditProfile extends EditRecord
{
    protected static string $resource = ProfileResource::class;

    // I am doing this so the route can be visited without
    // providing the ID to the URL
    public function mount(): void
    {
        $this->record = $this->resolveRecord(auth()->user()->profile());

        $this->authorizeAccess();

        $this->fillForm();

        $this->previousUrl = url()->previous();
    }
// ProfileResource.php

    public static function getPages(): array
    {
        return [
            // I named it index so that it is still
            // in the navigation
            'index' => Pages\EditProfile::route('/'),
        ];
    }

// ProfileResourse/Pages/EditProfile.php
class EditProfile extends EditRecord
{
    protected static string $resource = ProfileResource::class;

    // I am doing this so the route can be visited without
    // providing the ID to the URL
    public function mount(): void
    {
        $this->record = $this->resolveRecord(auth()->user()->profile());

        $this->authorizeAccess();

        $this->fillForm();

        $this->previousUrl = url()->previous();
    }


This approach can not work because i am overloading mount with the wrong number of arguments.
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

One record resource
FilamentFFilament / ❓┊help
3y ago
Filament Resource only edit page?
FilamentFFilament / ❓┊help
2y ago
Unable to edit Resource in Resource table
FilamentFFilament / ❓┊help
2y ago
allow unauthenticated users read only access to resource
FilamentFFilament / ❓┊help
3y ago