1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00
invoiceninja/app/Http/Requests/InvoiceRequest.php

19 lines
417 B
PHP
Raw Normal View History

2016-05-01 21:30:39 +02:00
<?php namespace App\Http\Requests;
class InvoiceRequest extends EntityRequest {
protected $entityType = ENTITY_INVOICE;
public function entity()
{
2016-05-01 22:55:13 +02:00
$invoice = parent::entity();
2016-05-01 21:30:39 +02:00
// eager load the invoice items
if ($invoice && ! $invoice->relationLoaded('invoice_items')) {
2016-05-01 22:55:13 +02:00
$invoice->load('invoice_items');
2016-05-01 21:30:39 +02:00
}
2016-05-01 22:55:13 +02:00
return $invoice;
2016-05-01 21:30:39 +02:00
}
2016-05-01 22:55:13 +02:00
2016-05-01 21:30:39 +02:00
}