Skip to content

Commit

Permalink
fix: Dynamically determine if tenant is set (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa authored Jan 13, 2025
1 parent 837e041 commit e730094
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Controllers/MailDownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e730094

Please sign in to comment.