feat: send WhatsApp notification on PO confirmed
This commit is contained in:
1 parent
d1f40c4124
commit
358907bbed
2 files changed
+34
No files matched your search
@@ -8,6 +8,7 @@ use App\Models\PurchaseOrder;
|
||||
use App\Models\PurchaseOrderItem;
|
||||
use App\Models\PurchaseRequest;
|
||||
use App\Models\Supplier;
|
||||
use App\Notifications\Purchase\PurchaseOrderConfirmedNotification;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PurchaseOrderController extends Controller
|
||||
@@ -62,6 +63,10 @@ class PurchaseOrderController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
if ($order->supplier && $order->supplier->whatsapp_number) {
|
||||
$order->supplier->notify(new PurchaseOrderConfirmedNotification($order));
|
||||
}
|
||||
|
||||
return redirect()->route('purchase.orders.show', $order)->with('success', 'Purchase order created successfully.');
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user