create-prisma-php-app 1.9.7 → 1.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,6 +7,9 @@ use PHPMailer\PHPMailer\Exception;
|
|
|
7
7
|
use Lib\Prisma\Classes\Validator;
|
|
8
8
|
use Dotenv\Dotenv;
|
|
9
9
|
|
|
10
|
+
$dotenv = Dotenv::createImmutable(\DOCUMENT_PATH);
|
|
11
|
+
$dotenv->load();
|
|
12
|
+
|
|
10
13
|
class Mailer
|
|
11
14
|
{
|
|
12
15
|
private PHPMailer $mail;
|
|
@@ -14,9 +17,6 @@ class Mailer
|
|
|
14
17
|
|
|
15
18
|
public function __construct()
|
|
16
19
|
{
|
|
17
|
-
$dotenv = Dotenv::createImmutable(\DOCUMENT_PATH);
|
|
18
|
-
$dotenv->load();
|
|
19
|
-
|
|
20
20
|
$this->mail = new PHPMailer(true);
|
|
21
21
|
$this->setup();
|
|
22
22
|
|
|
@@ -84,8 +84,8 @@ class Mailer
|
|
|
84
84
|
$this->mail->AltBody = $altBody;
|
|
85
85
|
|
|
86
86
|
return $this->mail->send();
|
|
87
|
-
} catch (\Exception) {
|
|
88
|
-
|
|
87
|
+
} catch (\Exception $e) {
|
|
88
|
+
throw new \Exception($e->getMessage());
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -115,7 +115,7 @@ abstract class Utility
|
|
|
115
115
|
$relation = $field['decorators']['relation'] ?? null;
|
|
116
116
|
$inverseRelation = $field['decorators']['inverseRelation'] ?? null;
|
|
117
117
|
|
|
118
|
-
if (isset($relation['name']) && $relation['name'] == $key || isset($inverseRelation['
|
|
118
|
+
if (isset($relation['name']) && $relation['name'] == $key || isset($inverseRelation['fromField']) && $inverseRelation['fromField'] == $key) $isRelatedModel = true;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
if ($isRelatedModel) continue;
|