improve cods

This commit is contained in:
2025-07-22 16:09:08 +03:30
parent ce5e140d41
commit 0c3802fd9e
11 changed files with 156 additions and 226 deletions

View File

@@ -14,6 +14,7 @@ class Accident extends Model
use ReceiptReportAble, HasFactory;
protected $guarded = [];
protected $appends = ['link'];
public static function boot()
{
@@ -118,4 +119,11 @@ class Accident extends Model
get: fn($value) => $value == null ? null : Storage::disk('public')->url($value)
);
}
protected function link(): Attribute
{
return Attribute::make(
get: fn (string $value) => env("PAYMENT_LINK")."/#/pay/".explode("/", $this->bill_code)[0]."/{$this->final_amount}",
);
}
}