jstoone / nova-mailman

Conveniently route all emails to a local mailbox.
https://novapackages.com/packages/jstoone/nova-mailman
MIT License
45 stars 1 forks source link

Laravel 6: Call to undefined function Jstoone\Mailman\array_first() #26

Open 4n70w4 opened 4 years ago

4n70w4 commented 4 years ago
Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined function Jstoone\Mailman\array_first()

/var/www/app/vendor/jstoone/nova-mailman/src/DeliverToInbox.php:91
/var/www/app/vendor/jstoone/nova-mailman/src/DeliverToInbox.php:83
/var/www/app/vendor/jstoone/nova-mailman/src/DeliverToInbox.php:41
/var/www/app/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:366
/var/www/app/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196
/var/www/app/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php:519
/var/www/app/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php:261
/var/www/app/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php:159
/var/www/app/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php:19
/var/www/app/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php:160
/var/www/app/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php:275
/var/www/app/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php:229
/var/www/app/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php:127
4n70w4 commented 4 years ago
@package jstoone/nova-mailman

Index: src/DeliverToInbox.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/DeliverToInbox.php  (date 1576755583296)
+++ src/DeliverToInbox.php  (date 1576755583296)
@@ -4,6 +4,7 @@

 use Illuminate\Contracts\Filesystem\Filesystem;
 use Illuminate\Mail\Events\MessageSent;
+use Illuminate\Support\Arr;
 use Swift_Message;

 class DeliverToInbox
@@ -88,7 +89,7 @@
     {
         return json_encode([
             'id'        => $this->identifier,
-            'recipient' => array_first(array_keys($message->getTo())),
+            'recipient' => Arr::first(array_keys($message->getTo())),
             'subject'   => $message->getSubject(),
             'sent_at'   => (string) now(),
             'link'      => route('nova-mailman.show', $this->identifier),