AdamT
2 months ago
320
3
Nova

Add custom method to Laravel Nova Trend (TrendResult)

Posted 2 months ago by AdamT

Hi all:

I was wondering if it was possible to add an additional method to a Nova Trend Metric?

I would like to add modified version of showLatestValue() which is defined in Laravel\Nova\Metrics\TrendResult. I have already written the method and it works if I insert it directly into the TrendResult class.

Of course this is not ideal as it would get overridden with any Nova updates.

What would be the best way to insert this method without directly updating TrendResult?

Cheers, Adam

Please sign in or create an account to participate in this conversation.