Build everything to deal with tax rates.
This commit is contained in:
@@ -4,8 +4,28 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Number;
|
||||
|
||||
class Taxrate extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'rate',
|
||||
'active',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that are appended with attribute getters.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $appends = [
|
||||
'rate_percentage',
|
||||
];
|
||||
public function getRatePercentageAttribute()
|
||||
{
|
||||
return Number::percentage($this->rate, 2, 8, 'de');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user