diff --git a/app/Events/Invoice/InvoiceWasPaid.php b/app/Events/Invoice/InvoiceWasPaid.php index 34c574275a86..a5a8812f1b90 100644 --- a/app/Events/Invoice/InvoiceWasPaid.php +++ b/app/Events/Invoice/InvoiceWasPaid.php @@ -1,4 +1,5 @@ company->company_key}"), + ]; + } + + public function broadcastWith(): array + { + $manager = new Manager(); + $manager->setSerializer(new ArraySerializer()); + $class = sprintf('App\\Transformers\\%sTransformer', class_basename($this->invoice)); + + $transformer = new $class(); + + $resource = new Item($this->invoice, $transformer, $this->invoice->getEntityType()); + $data = $manager->createData($resource)->toArray(); + + return $data; + } +} diff --git a/config/broadcasting.php b/config/broadcasting.php index fa0beea47388..34f0cf4736de 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -32,18 +32,15 @@ return [ 'pusher' => [ 'driver' => 'pusher', - 'key' => env('PUSHER_APP_KEY', ''), - 'secret' => env('PUSHER_APP_SECRET', ''), - 'app_id' => env('PUSHER_APP_ID', ''), + 'key' => env('PUSHER_APP_KEY', 'app-key'), + 'secret' => env('PUSHER_APP_SECRET', 'app-secret'), + 'app_id' => env('PUSHER_APP_ID', 'app-id'), 'options' => [ - 'host' => env('PUSHER_HOST', 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com'), - 'port' => env('PUSHER_PORT', 443), - 'scheme' => env('PUSHER_SCHEME', 'https'), - 'encrypted' => false, - 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', - ], - 'client_options' => [ - // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html + 'host' => env('PUSHER_HOST', '127.0.0.1'), + 'port' => env('PUSHER_PORT', 6001), + 'scheme' => env('PUSHER_SCHEME', 'http'), + 'encrypted' => true, + 'useTLS' => env('PUSHER_SCHEME') === 'https', ], ], diff --git a/lang/en/texts.php b/lang/en/texts.php index a382efddb223..da68244a125b 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5334,6 +5334,8 @@ $lang = array( 'country_Ceuta' => 'Ceuta', 'country_Canary Islands' => 'Canary Islands', 'lang_Vietnamese' => 'Vietnamese', + 'invoice_status_changed' => 'Please note that the status of your invoice has been updated. We recommend refreshing the page to view the most current version.', + 'no_unread_notifications' => 'You’re all caught up! No new notifications.', ); return $lang; diff --git a/routes/channels.php b/routes/channels.php index 9d8de62648d0..0395b473facb 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -20,4 +20,4 @@ Broadcast::channel('company-{company_key}', function (\App\Models\User $user, string $company_key) { return $user->company()->company_key === $company_key; -}); \ No newline at end of file +});