© 2026 Hedgehog Software, LLC

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

How to change a label for a field, in view page?

I have a Main Resource file, that defines the form like so (See attached image).


I am needing to change the field label only when viewing a record, based on a
if
if
condition on what the value of this record is. For example:

If value is
FR
FR
then the label should be
Company Registration France
Company Registration France
.

How can I achieve so in the View Page file?

<?php

namespace App\Filament\Resources\AllClientsResource\Pages;

use App\Filament\Resources\AllClientsResource;
use Filament\Resources\Pages\ViewRecord;

class ViewClient extends ViewRecord
{
    protected static string $resource = AllClientsResource::class;

    protected function mutateFormDataBeforeFill(array $data): array
    {

        return $data;
    }
}
<?php

namespace App\Filament\Resources\AllClientsResource\Pages;

use App\Filament\Resources\AllClientsResource;
use Filament\Resources\Pages\ViewRecord;

class ViewClient extends ViewRecord
{
    protected static string $resource = AllClientsResource::class;

    protected function mutateFormDataBeforeFill(array $data): array
    {

        return $data;
    }
}
image.png
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

Changing field wrapper view, to change label styling
FilamentFFilament / ❓┊help
3y ago
how to add field to a view page?
FilamentFFilament / ❓┊help
3y ago
change view dynamically in a page
FilamentFFilament / ❓┊help
3y ago
Label on form field, custom view
FilamentFFilament / ❓┊help
3y ago