How do we overwrite all resource pages?

I'm trying to change how the heading works across all pages without editing them all. Tried using macro but this doesn't get called. Also tried aliasing the BasePage class. Is there another way?
\Filament\Pages\BasePage::macro('getHeading', function (): string|Htmlable {
return 'Test Heading';
});
\Filament\Pages\BasePage::macro('getHeading', function (): string|Htmlable {
return 'Test Heading';
});
4 Replies
WyreZ
WyreZ4w ago
In your main panel on AdminPanelProvider.php you might need to set ->brandName('Your Global Page Title') Is that what you mean? If this is the same issue that I had, the docs were very hard to find a good answer for this.
gizmojo
gizmojo4w ago
awcodes
awcodes4w ago
You will probably have to extend the Edit and Create Record classes. I’m not sure that macros work to override existing methods. I could be wrong though.
Chrispian
Chrispian4w ago
I don't think marcos work like this. I would use a trait if it's something this common. You would still need to add it to each resource but you could probably modify the stubs for filament. Also, here's a nice little trick from @Zep Fietje to go along with it. https://x.com/zepfietje/status/1798660116020965810
Zep Fietje (@zepfietje) on X
Came up with a neat way of reusing @filamentphp render hooks. 💡 Instead of registering the hook in a service provider for given scopes, I moved it to the boot method of a trait. Now any page that uses the HasFooterActions trait will automatically render the footer actions. 👌
From An unknown user
Twitter
Want results from more Discord servers?
Add your server
More Posts
Unable to use tabs in listview. trim(): Argument #1 ($string) must be of type string, Filament\Suppo```php class ListAppointments extends ListRecords { protected static string $resource = AppointmafterStateUpdated results in unpredictable resultStraight from Filament docs, i am trying to use afterStateUpdated to generate a Slug for the field. Sum summarizer not respecting MoneyCast in table outputI'm following along with the 'Getting Started' tutorial and trying out table summaries but seem to hResource StructureHi all. Just wondered what the best way to approach this would be: I am going to have a number of rHide all records in the tableHi, I have a question: how can I hide all records in the table as long as a filter option is not selmutateFormDataBeforeCreate not running on create from Relation ManagerI have a Filament resource and in its Create page I implemented the mutateFormDataBeforeCreate methoIs Filament adequate for any type of web app? Or is it more focused on admin panels?Total newbie here. Sorry if this is not the correct place to ask this. I couldn't find a similar queHelp Needed with Sorting an Accessor in Filament TableI'm working on a Filament table where I need to display and sort by a computed accessor, `formatted_Illuminate\Contracts\Container\BindingResolutionExceptionTarget class [universal] does not exist.I have a small problem that when I try to log into the filament admin panel I get this, taking into double tooltips, workaround not working.I have an action and it is showing double tooltips (See screenshot). I successfully removed the br