diff --git a/src/Controllers/MailDownloadController.php b/src/Controllers/MailDownloadController.php index 85f88ec..50af302 100644 --- a/src/Controllers/MailDownloadController.php +++ b/src/Controllers/MailDownloadController.php @@ -8,12 +8,15 @@ class MailDownloadController extends Controller { - public function __invoke( - ?string $tenant, - string $mail, - string $attachment, - string $filename - ) { + public function __invoke(...$arguments) + { + if (count($arguments) === 4) { + [$tenant, $mail, $attachment, $filename] = $arguments; + } else { + [$mail, $attachment, $filename] = $arguments; + $tenant = null; + } + /** @var MailAttachment $attachment */ $attachment = MailAttachment::find($attachment);