Starting on the API

This commit is contained in:
Hillel Coren 2014-05-13 22:20:54 +03:00
parent 38008fa5c2
commit 561907ae60
4 changed files with 36 additions and 5 deletions

View File

@ -0,0 +1,27 @@
<?php
use ninja\repositories\ClientRepository;
use Client;
class ClientApiController extends \BaseController {
protected $clientRepo;
public function __construct(ClientRepository $clientRepo)
{
parent::__construct();
$this->clientRepo = $clientRepo;
}
public function index()
{
$clients = Client::scope()->get()->toArray();
return Response::json(array(
'error' => false,
'clients' => $clients),
200
);
}
}

View File

@ -109,6 +109,11 @@ Route::group(array('before' => 'auth'), function()
Route::post('credits/bulk', 'CreditController@bulk'); 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 // If you're self hosting set this to a value you think is fair
define('PRO_PLAN_PRICE', 50); define('PRO_PLAN_PRICE', 50);

View File

@ -6,6 +6,7 @@
div > label.control-label div > label.control-label
{ {
font-weight: bold !important; font-weight: bold !important;
/* text-transform:uppercase; */
} }
</style> </style>

View File

@ -17,7 +17,7 @@
<div class="headline"> <div class="headline">
<div class="icon open"><span class="img-wrap"><img src="{{ asset('images/icon-opensource.png') }}"></span></div><h2>Open Source Platform</h2> <div class="icon open"><span class="img-wrap"><img src="{{ asset('images/icon-opensource.png') }}"></span></div><h2>Open Source Platform</h2>
</div> </div>
<p class="first">Set the code free! Here at Invoice Ninja, were all about being non-evil, and providing full code transparency is a central manifestation of this value.</p> <p class="first">Set the code free! Here at Invoice Ninja, were all about creating the best possible app, and inviting scrutiny via full code transparency is a central manifestation of this value.</p>
<p>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. <p>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.
</p> </p>
<p>We firmly believe that being an open source product helps everyone involved. Were looking forward to seeing what the developers out there can do to take Invoice Ninja into new realms of usefulness.</p> <p>We firmly believe that being an open source product helps everyone involved. Were looking forward to seeing what the developers out there can do to take Invoice Ninja into new realms of usefulness.</p>
@ -43,10 +43,8 @@
<div class="headline"> <div class="headline">
<div class="icon free"><span class="img-wrap"><img src="{{ asset('images/icon-free2.png') }}"></span></div><h2>FREE. Forever.</h2> <div class="icon free"><span class="img-wrap"><img src="{{ asset('images/icon-free2.png') }}"></span></div><h2>FREE. Forever.</h2>
</div> </div>
<p class="first">Set the code free! Here at Invoice Ninja, were all about being non-evil, and providing full code transparency is a central manifestation of this value.</p> <p class="first">Yeah, you read that correctly. You dont 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 were bent on providing a top-notch product that will do everything you need it to do, without any subscription or opt-in fees. </p>
<p>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. <p>Try Invoice Ninja out. You literally have nothing to lose. Were confident that youll find the experience so positive that youll never need to turn elsewhere.</p>
</p>
<p>We firmly believe that being an open source product helps everyone involved. Were looking forward to seeing what the developers out there can do to take Invoice Ninja into new realms of usefulness.</p>
</div> </div>
</div> </div>