diff --git a/src/app/SharedFolder.php b/src/app/SharedFolder.php index d17ac9ca..5aa28943 100644 --- a/src/app/SharedFolder.php +++ b/src/app/SharedFolder.php @@ -1,117 +1,117 @@ domain)) { $domainName = $this->domain; } else { list($local, $domainName) = explode('@', $this->email); } return Domain::where('namespace', $domainName)->first(); } /** * Find whether an email address exists as a shared folder (including deleted folders). * * @param string $email Email address * @param bool $return_folder Return SharedFolder instance instead of boolean * * @return \App\SharedFolder|bool True or Resource model object if found, False otherwise */ public static function emailExists(string $email, bool $return_folder = false) { if (strpos($email, '@') === false) { return false; } $email = \strtolower($email); $folder = self::withTrashed()->where('email', $email)->first(); if ($folder) { return $return_folder ? $folder : true; } return false; } /** * Folder type mutator * * @throws \Exception */ public function setTypeAttribute($type) { if (!in_array($type, self::SUPPORTED_TYPES)) { throw new \Exception("Invalid shared folder type: {$type}"); } $this->attributes['type'] = $type; } }