parfum/app/Traits/Order/WithDiscount.php
Yoga Pangestu d5fae1989a feat(order): membuat crud
-skema migrasi dan menyesuaikan relasi model nya
-membuat beberapa trait utuk memisahkan logika
2025-10-27 19:25:10 +07:00

15 lines
251 B
PHP

<?php
namespace App\Traits\Order;
trait WithDiscount
{
public function updatedFormDiscount(string $value)
{
$total = $this->getTotal();
$discount = replaceCurrency($value);
$this->total = $total - $discount;
}
}