mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge branch 'v5-develop' into v5-develop
Signed-off-by: David Bomba <turbo124@gmail.com>
This commit is contained in:
commit
b1b301cc0c
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
@ -14,14 +15,16 @@ namespace App\Events\Invoice;
|
||||
use App\Models\Company;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Utils\Traits\Invoice\Broadcasting\DefaultInvoiceBroadcast;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class InvoiceWasPaid.
|
||||
*/
|
||||
class InvoiceWasPaid
|
||||
class InvoiceWasPaid implements ShouldBroadcast
|
||||
{
|
||||
use SerializesModels;
|
||||
use SerializesModels, DefaultInvoiceBroadcast;
|
||||
|
||||
/**
|
||||
* @var Invoice
|
||||
|
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Utils\Traits\Invoice\Broadcasting;
|
||||
|
||||
use App\Transformers\ArraySerializer;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use League\Fractal\Manager;
|
||||
use League\Fractal\Resource\Item;
|
||||
|
||||
trait DefaultInvoiceBroadcast
|
||||
{
|
||||
public function broadcastOn(): array
|
||||
{
|
||||
return [
|
||||
new PrivateChannel("company-{$this->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;
|
||||
}
|
||||
}
|
@ -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',
|
||||
],
|
||||
],
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user