vendredi 5 février 2016

Serialization of closure failed: The closure was not found within the abstract syntax tree

I am receiving this error in production but not in local testing:

"Serialization of closure failed: The closure was not found within the abstract syntax tree."

I use Homestead/Vagrant on my local machine to ensure the environment is similar to production and I cannot track down why I started receiving this in production when I did not receive it at all in local testing.

The snippet of code is below, any thoughts are greatly appreciated.

 foreach ($notifications as $notification) {
            $data = array('eventInfo' => $eventInfo, 'bowlerInfo' => $bowlerInfo, 'bowlerSchoolInfo' => $bowlerSchoolInfo,
                'matchInfo' => $match, 'notificationInfo' => $notification);

            Mail::queue('emails.matchEventAddedNotification', $data, function ($message) use ($notification, $bowlerInfo) {

                $dataHeader['category'] = 'Match Event Notification';
                $dataHeader['unique_args']['message'] = 'Email related to a new match event notification.';
                $dataHeader['unique_args']['bowler_id'] = $bowlerInfo['id'];
                $dataHeader['unique_args']['matchevents_notify_id'] = $notification['id'];
                $header = json_encode($dataHeader);
                $message->getSwiftMessage()->getHeaders()->addTextHeader('X-SMTPAPI', $header);
                $message->subject('New Score Added For' . ' ' . $bowlerInfo['first_name'] . ' ' . $bowlerInfo['last_name']);
                $message->to($notification['email']);
            });

            $matcheventNotify = Matchevent_Notify::find($notification['id']);
            $matcheventNotify->last_sent = Carbon::now();
            $matcheventNotify->save();
        }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire