-
app/Helper.php
Open in GitHubclass Helper { public static function formatNumber($number): string { return number_format($number, 2, '.', ''); } // }
-
app/Models/Budget.php
Open in GitHubuse App\Helper; use Illuminate\Database\Eloquent\Model; class Budget extends Model { // public function getFormattedSpentAttribute() { return Helper::formatNumber($this->spent / 100); } }