From 561907ae60e202243d1fc681de6edfee4749c67e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 13 May 2014 22:20:54 +0300 Subject: [PATCH] Starting on the API --- app/controllers/ClientApiController.php | 27 +++++++++++++++++++++++++ app/routes.php | 5 +++++ app/views/payments/payment.blade.php | 1 + app/views/public/features.blade.php | 8 +++----- 4 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 app/controllers/ClientApiController.php diff --git a/app/controllers/ClientApiController.php b/app/controllers/ClientApiController.php new file mode 100644 index 000000000000..3e6644232dfc --- /dev/null +++ b/app/controllers/ClientApiController.php @@ -0,0 +1,27 @@ +clientRepo = $clientRepo; + } + + public function index() + { + $clients = Client::scope()->get()->toArray(); + + return Response::json(array( + 'error' => false, + 'clients' => $clients), + 200 + ); + } +} \ No newline at end of file diff --git a/app/routes.php b/app/routes.php index 717221809573..d0506ad7028b 100755 --- a/app/routes.php +++ b/app/routes.php @@ -109,6 +109,11 @@ Route::group(array('before' => 'auth'), function() Route::post('credits/bulk', 'CreditController@bulk'); }); +// Route group for API versioning +Route::group(array('prefix' => 'api/v1', 'before' => 'auth.basic'), function() +{ + Route::resource('clients', 'ClientApiController'); +}); // If you're self hosting set this to a value you think is fair define('PRO_PLAN_PRICE', 50); diff --git a/app/views/payments/payment.blade.php b/app/views/payments/payment.blade.php index 7261ad0b2389..c01f19ae7f61 100755 --- a/app/views/payments/payment.blade.php +++ b/app/views/payments/payment.blade.php @@ -6,6 +6,7 @@ div > label.control-label { font-weight: bold !important; + /* text-transform:uppercase; */ } diff --git a/app/views/public/features.blade.php b/app/views/public/features.blade.php index d9a74ebb57d5..917e6c105a4a 100644 --- a/app/views/public/features.blade.php +++ b/app/views/public/features.blade.php @@ -17,7 +17,7 @@

Open Source Platform

-

Set the code free! Here at Invoice Ninja, we’re all about being non-evil, and providing full code transparency is a central manifestation of this value.

+

Set the code free! Here at Invoice Ninja, we’re all about creating the best possible app, and inviting scrutiny via full code transparency is a central manifestation of this value.

Our users started seeing the benefits of open source within days of our launch, when we rolled out v1.0.2, which included some key code improvements that our friends on GitHub sent our way.

We firmly believe that being an open source product helps everyone involved. We’re looking forward to seeing what the developers out there can do to take Invoice Ninja into new realms of usefulness.

@@ -43,10 +43,8 @@

FREE. Forever.

-

Set the code free! Here at Invoice Ninja, we’re all about being non-evil, and providing full code transparency is a central manifestation of this value.

-

Our users started seeing the benefits of open source within days of our launch, when we rolled out v1.0.2, which included some key code improvements that our friends on GitHub sent our way. -

-

We firmly believe that being an open source product helps everyone involved. We’re looking forward to seeing what the developers out there can do to take Invoice Ninja into new realms of usefulness.

+

Yeah, you read that correctly. You don’t have to pay us a cent to use our tools. We know how tough it is to make ends meet as a web-based business, and we’re bent on providing a top-notch product that will do everything you need it to do, without any subscription or opt-in fees.

+

Try Invoice Ninja out. You literally have nothing to lose. We’re confident that you’ll find the experience so positive that you’ll never need to turn elsewhere.