Skip to main content

Money Column and Mutate Data Before Saving/Showing

Premium
3:48

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

hdaklue avatar

Is it okay to move this part to the model itself, using mutators and accessors?

Povilas Korop avatar

Never tried, I was doing it according to Filament docs. It should work on the Model level but may have negative consequences in how Filament then shows that data. Please try.

hdaklue avatar

Worked fine but with setting should convert to true.

Tables\Columns\TextColumn::make("default_rate")->money(
                    config("app.currency"),
                    true
                )