2019-07-10 03:42:34 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2020-01-07 01:13:47 +01:00
|
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-07-10 03:42:34 +02:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Contact;
|
|
|
|
|
2019-07-10 05:10:18 +02:00
|
|
|
use App\Filters\InvoiceFilters;
|
2019-07-10 03:42:34 +02:00
|
|
|
use App\Http\Controllers\BaseController;
|
|
|
|
use App\Models\Invoice;
|
|
|
|
use App\Transformers\Contact\InvoiceTransformer;
|
|
|
|
use App\Utils\Traits\MakesHash;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
class InvoiceController extends BaseController
|
|
|
|
{
|
|
|
|
use MakesHash;
|
|
|
|
|
|
|
|
protected $entity_type = Invoice::class;
|
|
|
|
|
|
|
|
protected $entity_transformer = InvoiceTransformer::class;
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-07-12 07:03:30 +02:00
|
|
|
* List Invoices
|
2019-07-10 03:42:34 +02:00
|
|
|
*
|
2019-07-12 07:03:30 +02:00
|
|
|
* @param \App\Filters\InvoiceFilters $filters The filters
|
2019-07-10 03:42:34 +02:00
|
|
|
*
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
*/
|
2019-07-10 05:10:18 +02:00
|
|
|
public function index(InvoiceFilters $filters)
|
2019-07-10 03:42:34 +02:00
|
|
|
{
|
2019-07-10 05:10:18 +02:00
|
|
|
$invoices = Invoice::filter($filters);
|
2019-07-10 03:42:34 +02:00
|
|
|
|
|
|
|
return $this->listResponse($invoices);
|
|
|
|
}
|
2019-12-30 22:59:12 +01:00
|
|
|
}
|