Adding title to a stats overview widget
Hello, i created some simple stats overview widget with the php artisan command. How can i add a title above it? Haven't found anything in the documentation about that. Thanks in advance.
5 Replies
im talking about a simple widget like this -
should i actually override its
render
method?
anyone, please?You could customize the view:
Which blade file then does one override to make the relevant changes
what?
Yes, you could override the
render()
method and have it call a different template, one that you copy from the base and make adjustments to. Just be sure to update it anytime the base templates get updated.
Notice how use Filament\Widgets\StatsOverviewWidget\Stat;
is part of the generated stats widget ? If you scroll to the bottom of that class you'll see the render() method which names which blade template it uses.