Merge pull request #18131 from Godmartinz/fix-inventory-alert-notification-misfire

Adds a null check for items and threshold in inventory alert notification
This commit is contained in:
snipe
2025-10-30 20:11:24 +00:00
committed by GitHub

View File

@@ -2,10 +2,12 @@
namespace App\Notifications;
use AllowDynamicProperties;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
#[AllowDynamicProperties]
class InventoryAlert extends Notification
{
use Queueable;
@@ -32,9 +34,8 @@ class InventoryAlert extends Notification
*/
public function via()
{
$notifyBy = ['mail'];
return (!empty($this->items) && $this->threshold !== null) ? ['mail'] : [];
return $notifyBy;
}
/**