Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: array_keys(): Argument #1 ($array) must be of type array #18

Closed
Sirajunnasihin opened this issue Jan 17, 2025 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@Sirajunnasihin
Copy link

What happened?

this error appear array_keys(): Argument #1 ($array) must be of type array, null given

How to reproduce the bug

i just click resend email button and this happen

Package Version

2.0.0

PHP Version

8.3.15

Laravel Version

11.38.2

Which operating systems does with happen with?

Windows

Notes

No response

@Sirajunnasihin Sirajunnasihin added the bug Something isn't working label Jan 17, 2025
@Baspa Baspa self-assigned this Jan 17, 2025
@Baspa
Copy link
Member

Baspa commented Jan 17, 2025

Can you tell me on which line this occurs? @Sirajunnasihin

@Sirajunnasihin
Copy link
Author

Filename : vormkracht10\filament-mails\src\Resources\MailResource.php at line 390

->tooltip(__('Resend'))
  ->form(self::getResendForm())
  ->fillForm(function (Mail $record) {
      return [
          'to' => array_keys($record->to),
          'cc' => array_keys($record->cc), // this line
          'bcc' => array_keys($record->bcc),
      ];
  })
  ->action(function (Mail $record, array $data) {
      (new ResendMail)->handle($record, $data['to'], $data['cc'] ?? [], $data['bcc'] ?? []);

      Notification::make()
          ->title(__('Mail will be resent in the background'))
          ->success()
          ->send();
  }),

@Baspa
Copy link
Member

Baspa commented Jan 20, 2025

Fixed in #19

@Baspa Baspa closed this as completed Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants