F
Filament3mo 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 Koch3mo ago
I don't think you can override traits in PHP. But you can override the methods.
Erik
Erik3mo 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" ]