I am fairly new in Laravel and Blade templating. Can anyone help show me how to do this?
I have a view like this:
@foreach ($Expen
If you are using Eloquent, in your model put:
public function getPriceAttribute($price) { return $this->attributes['price'] = sprintf('U$ %s', number_format($price, 2)); }
Where getPriceAttribute is your field on database. getSomethingAttribute.