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