Skip to content

Commit

Permalink
Dynamically determine if tenant is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Jan 13, 2025
1 parent 837e041 commit 0420be3
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 0420be3

Please sign in to comment.