client = $client; } /** * Handle the event. * * @param DatabaseNotification $notification * @return void */ public function handle(DatabaseNotification $notification) { if (app()->environment('local')) { return; } $user = $notification->notifiable; if (!$user->registration_id) { return; } // 推送消息 $this->client->push() ->setPlatform('all') ->addRegistrationId($user->registration_id) ->setNotificationAlert(strip_tags($notification->data['reply_content'])) ->send(); } }