THY
Getting filament to use my own getLabel() implementation
The
Filament\Tables\Columns\Column
uses the Concerns\HasLabel
trait.
Inside this trait, there is a method named getLabel()
I would like to customize it a little bit.
First, I duplicated the original HasLabel.php
to put it under app/Filament/Tables/Columns/Concerns
project folder and customize the getLabel()
method to just return a test string:
Then I created the Column.php
file under app\Filament\Tables\Columns\Column
with the following codes to, extends from the original one and make it use my own version of HasLabel
trait:
Next is adding the class binding in the AppServiceProvider
:
Finally, I ran these commands to make sure the changes are known by both Laravel and Filament:
Unfortunately, I still don't get the label output "test". Filament does not seem to be using my version of Column class and HasLabel trait at all.
It's still using its own ones.
Why can't they be discovered?2 replies