2017-01-30 20:40:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
2016-06-06 21:19:49 +02:00
|
|
|
|
|
|
|
use App\Models\Invoice;
|
|
|
|
use App\Ninja\Repositories\InvoiceRepository;
|
2017-01-30 20:40:43 +01:00
|
|
|
use Response;
|
2016-06-06 21:19:49 +02:00
|
|
|
|
2017-04-12 14:32:10 +02:00
|
|
|
class QuoteApiController extends InvoiceApiController
|
2016-06-06 21:19:49 +02:00
|
|
|
{
|
|
|
|
protected $invoiceRepo;
|
|
|
|
|
|
|
|
protected $entityType = ENTITY_INVOICE;
|
|
|
|
|
2017-03-08 17:03:35 +01:00
|
|
|
/**
|
|
|
|
* @SWG\Get(
|
|
|
|
* path="/quotes",
|
2017-03-09 17:22:37 +01:00
|
|
|
* summary="List quotes",
|
|
|
|
* operationId="listQuotes",
|
2017-03-08 17:03:35 +01:00
|
|
|
* 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"
|
|
|
|
* )
|
|
|
|
* )
|
|
|
|
*/
|
2016-06-06 21:19:49 +02:00
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
$invoices = Invoice::scope()
|
|
|
|
->withTrashed()
|
|
|
|
->quotes()
|
|
|
|
->with('invoice_items', 'client')
|
|
|
|
->orderBy('created_at', 'desc');
|
|
|
|
|
|
|
|
return $this->listResponse($invoices);
|
|
|
|
}
|
|
|
|
}
|