F
Filament9mo ago
Erik

Override traits in tables

Hey! What is the simplest solution to override two traits of Filament tables? I am working on a column turn on/off with database sync, and I really need this. The two affected traits are: Concerns\CanToggleColumns.php Concerns\InteractsWithTable.php
2 Replies
Dennis Koch
Dennis Koch9mo ago
I don't think you can override traits in PHP. But you can override the methods.
Erik
ErikOP9mo ago
I have found a good workaround for this problem: at composer.json file, autoload section: "exclude-from-classmap": [ "vendor/filament/tables/src/Concerns/CanToggleColumns.php", "vendor/filament/tables/src/Concerns/InteractsWithTable.php" ], "files": [ "app/Overrides/filament/tables/src/Concerns/CanToggleColumns.php", "app/Overrides/filament/tables/src/Concerns/InteractsWithTable.php" ]
Want results from more Discord servers?
Add your server