From f04412b01065b16e780c24859092b1d57be04b3a Mon Sep 17 00:00:00 2001 From: AmirHosein Rahimi Date: Fri, 21 Apr 2023 02:34:12 +0430 Subject: [PATCH] fix: bug in model --- src/Controllers/Modal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controllers/Modal.php b/src/Controllers/Modal.php index e1d9989..31f1446 100644 --- a/src/Controllers/Modal.php +++ b/src/Controllers/Modal.php @@ -14,7 +14,7 @@ public function __construct(?string $customKey = null, bool $open = false) $this->open = $open; // replace all characters except letters, numbers , _ and - to _ - $this->customKey = preg_replace('/[^a-zA-Z0-9_-]/', '_', $customKey); + $this->customKey = $customKey ? preg_replace('/[^a-zA-Z0-9_-]/', '_', $customKey) : null; } public static function make(?string $customKey = null): Modal