From 7730904bda2517a2693abfc7b5c53e72fbe1a621 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 6 Jun 2016 22:19:49 +0300 Subject: [PATCH] Added back API route for quotes --- app/Http/Controllers/QuoteApiController.php | 52 +++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 app/Http/Controllers/QuoteApiController.php diff --git a/app/Http/Controllers/QuoteApiController.php b/app/Http/Controllers/QuoteApiController.php new file mode 100644 index 000000000000..0a04b99bd004 --- /dev/null +++ b/app/Http/Controllers/QuoteApiController.php @@ -0,0 +1,52 @@ +invoiceRepo = $invoiceRepo; + } + + /** + * @SWG\Get( + * path="/quotes", + * tags={"quote"}, + * summary="List of quotes", + * @SWG\Response( + * response=200, + * description="A list with 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); + } + +}