2019-07-10 03:42:34 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-07-10 03:42:34 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-07-10 03:42:34 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-07-10 03:42:34 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
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;
|
2020-10-28 11:10:49 +01:00
|
|
|
use Illuminate\Http\Response;
|
2019-07-10 03:42:34 +02:00
|
|
|
|
|
|
|
class InvoiceController extends BaseController
|
|
|
|
{
|
|
|
|
use MakesHash;
|
|
|
|
|
|
|
|
protected $entity_type = Invoice::class;
|
|
|
|
|
|
|
|
protected $entity_transformer = InvoiceTransformer::class;
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* List Invoices.
|
2019-07-10 03:42:34 +02:00
|
|
|
*
|
2020-10-28 11:10:49 +01:00
|
|
|
* @param InvoiceFilters $filters The filters
|
2019-07-10 03:42:34 +02:00
|
|
|
*
|
2020-10-28 11:10:49 +01:00
|
|
|
* @return Response
|
2019-07-10 03:42:34 +02:00
|
|
|
*/
|
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);
|
2020-09-06 11:38:10 +02:00
|
|
|
|
2019-07-10 03:42:34 +02:00
|
|
|
return $this->listResponse($invoices);
|
|
|
|
}
|
2019-12-30 22:59:12 +01:00
|
|
|
}
|