diff --git a/app/Http/Controllers/QuoteApiController.php b/app/Http/Controllers/QuoteApiController.php new file mode 100644 index 000000000000..9acd645ed799 --- /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() + ->where('is_quote', '=', '1') + ->with('invoice_items', 'client') + ->orderBy('created_at', 'desc'); + + return $this->listResponse($invoices); + } + +} diff --git a/app/Http/routes.php b/app/Http/routes.php index d9e4b2964b7e..4955f9d159fe 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -251,8 +251,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'api/v1'], function() Route::get('accounts', 'AccountApiController@show'); Route::put('accounts', 'AccountApiController@update'); Route::resource('clients', 'ClientApiController'); - //Route::get('quotes', 'QuoteApiController@index'); - //Route::resource('quotes', 'QuoteApiController'); + Route::get('quotes', 'QuoteApiController@index'); Route::get('invoices', 'InvoiceApiController@index'); Route::get('download/{invoice_id}', 'InvoiceApiController@download'); Route::resource('invoices', 'InvoiceApiController');