This project recreates the table design from the open-source Wealthfolio app, featuring custom columns with badges, bold typography, and colorized multi-line cells.
The inspiration for this table is from an open-source project wealthfolio.
The whole table logic is in the HoldingResource
Filament Resource. For the market history, we have a simplified version, saving only the current and previous month's values in the database.
For the first column holding name, we added a prefix badge. To add a badge, we used the awcodes/filament-badgeable-column plugin.
The market_value
column is calculated in an Attribute and shown in a slightly bold font weight.
app/Models/Holding.php:
use App\Enum\Type;use App\Enum\Symbol;use App\Enum\Locale;use Illuminate\Database\Eloquent\Model;use Illuminate\Database\Eloquent\Casts\Attribute; class Holding extends Model{ protected $fillable = [ 'name', 'quantity', 'market_price_current_month', 'market_price_last_month', 'market_locale', 'type', 'symbol', ]; protected function casts(): array { return [ 'market_locale' => Locale::class, 'type' => Type::class, 'symbol' => Symbol::class, ]; } protected function marketValue(): Attribute { return Attribute::make( get: fn () => $this->market_price_current_month * $this->quantity, ); }}
Both the market_value
and market_price_current_month
columns are formatted using Filaments money()
helper.
The performance column is a custom column. In this column, we show the calculated difference in money and percentage. Also, we show an arrow indicating whether it's profit or loss. All the calculations are done in the columns PHP class.
app/Tables/Columns/Performance.php:
use Filament\Tables\Columns\Column; class Performance extends Column{// ...