If I executed my notification on production server, there exist error like this :
ErrorExceptionIlluminate\Notifications\SendQueuedNotifications preg_split() expects parameter 2 to be string, array given
I check the error using https://app.bugsnag.com
The full error like this :
On my localhost and my staging server it's no error
It's just error in production server
My notification like this :
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class CheckoutOrder extends Notification implements ShouldQueue, ShouldBroadcast
{
use Queueable;
private $data;
public function __construct($data)
{
$this->data = $data;
}
public function via($notifiable)
{
return ['mail','database','broadcast'];
}
public function toMail($notifiable)
{
return (new MailMessage)
->subject('test subject')
->view('vendor.notifications.mail.email-checkout-order',['data'=>$this->data, 'name' => $notifiable->name]);
}
public function toArray($notifiable)
{
return [
'id' => $this->data['invoice']->id,
'time' => $this->data['invoice']->created_at,
'group' => 'purchase',
];
}
}
My env like this :
APP_ENV=production
APP_KEY=secretkey
APP_DEBUG=false
APP_LOG_LEVEL=debug
APP_URL=https://secretapp.co.id
DB_CONNECTION=mysql
DB_HOST=secret
DB_HOST_MONGO=localhost
DB_PORT=3306
DB_DATABASE=secretdb
DB_USERNAME=secretusername
DB_PASSWORD=secretpassword
BROADCAST_DRIVER=pusher
CACHE_DRIVER=redis
SESSION_DRIVER=redis
QUEUE_DRIVER=redis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=secret@gmail.com
MAIL_PASSWORD=secret
MAIL_ENCRYPTION=tls
How can I solve this problem?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire