mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Invoice;
|
|
use App\Ninja\Repositories\InvoiceRepository;
|
|
use Response;
|
|
|
|
class QuoteApiController extends InvoiceApiController
|
|
{
|
|
protected $invoiceRepo;
|
|
|
|
protected $entityType = ENTITY_INVOICE;
|
|
|
|
/**
|
|
* @SWG\Get(
|
|
* path="/quotes",
|
|
* summary="List quotes",
|
|
* operationId="listQuotes",
|
|
* tags={"quote"},
|
|
* @SWG\Response(
|
|
* response=200,
|
|
* description="A list of quotes",
|
|
* @SWG\Schema(type="array", @SWG\Items(ref="#/definitions/Invoice"))
|
|
* ),
|
|
* @SWG\Response(
|
|
* response="default",
|
|
* description="an ""unexpected"" error"
|
|
* )
|
|
* )
|
|
*/
|
|
public function index()
|
|
{
|
|
$invoices = Invoice::scope()
|
|
->withTrashed()
|
|
->quotes()
|
|
->with('invoice_items', 'client')
|
|
->orderBy('created_at', 'desc');
|
|
|
|
return $this->listResponse($invoices);
|
|
}
|
|
}
|