mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-04 10:44:35 -04:00
Add client to recurring invoice transformer
This commit is contained in:
parent
6fb3f5a45d
commit
d3a9fb9dd7
@ -13,11 +13,13 @@ namespace App\Transformers;
|
|||||||
|
|
||||||
use App\Models\Activity;
|
use App\Models\Activity;
|
||||||
use App\Models\Backup;
|
use App\Models\Backup;
|
||||||
|
use App\Models\Client;
|
||||||
use App\Models\Document;
|
use App\Models\Document;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\RecurringInvoice;
|
use App\Models\RecurringInvoice;
|
||||||
use App\Models\RecurringInvoiceInvitation;
|
use App\Models\RecurringInvoiceInvitation;
|
||||||
use App\Transformers\ActivityTransformer;
|
use App\Transformers\ActivityTransformer;
|
||||||
|
use App\Transformers\ClientTransformer;
|
||||||
use App\Transformers\InvoiceHistoryTransformer;
|
use App\Transformers\InvoiceHistoryTransformer;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
|
||||||
@ -32,6 +34,7 @@ class RecurringInvoiceTransformer extends EntityTransformer
|
|||||||
|
|
||||||
protected $availableIncludes = [
|
protected $availableIncludes = [
|
||||||
'activities',
|
'activities',
|
||||||
|
'client',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function includeHistory(RecurringInvoice $invoice)
|
public function includeHistory(RecurringInvoice $invoice)
|
||||||
@ -62,6 +65,13 @@ class RecurringInvoiceTransformer extends EntityTransformer
|
|||||||
return $this->includeCollection($invoice->documents, $transformer, Document::class);
|
return $this->includeCollection($invoice->documents, $transformer, Document::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function includeClient(RecurringInvoice $invoice)
|
||||||
|
{
|
||||||
|
$transformer = new ClientTransformer($this->serializer);
|
||||||
|
|
||||||
|
return $this->includeItem($invoice->client, $transformer, Client::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function transform(RecurringInvoice $invoice)
|
public function transform(RecurringInvoice $invoice)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user