Enhance CardOrder model and SMS functionality
- Added unique ID generation and SMS notification upon CardOrder creation. - Updated CardOrdersTable to default sort by creation date. - Implemented logging for SMS sending in SmsRepository for better debugging.
This commit is contained in:
1 parent
c0bfe974ad
commit
59548a486f
4 files changed
+17
-1
No files matched your search
@@ -109,7 +109,16 @@ protected static function boot()
|
||||
parent::boot();
|
||||
|
||||
static::creating(LoanOrderRepository::creating());
|
||||
static::created(LoanOrderRepository::created());
|
||||
|
||||
static::created(function ($model) {
|
||||
$uniqueId = LoanOrderRepository::generateUniqueId($model);
|
||||
$model->update(['unique_id' => $uniqueId]);
|
||||
|
||||
sendSMS(
|
||||
$model->phone,
|
||||
__('module.card-order::base.card_order_created', ['order_id' => $uniqueId])
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'card_order_created' => 'Kart sargydyňyz :order_id belgi bilen hasaba alyndy. Sargydy tassyklamak üçin operatorymyz habarlaşar.',
|
||||
];
|
||||
Reference in new issue
Block a user