Monthly Archives: January 2015
-
January 30, 2015
RESTful API's are hard! There are a lot of aspects to designing and writing a successful one. For instance, some of the topics that you may find yourself handling include authentication, hypermedia/HATEOS, versioning, rate limits, and content negotiation. Rather than tackling all of these concepts, however, let's instead focus on the basics of REST. We'll make some JSON endpoints behind a basic authentication system, and learn a few Laravel 4 tricks in the process.
The App
Let's build an API for a simple Read-It-Later app. Users will be able to create, read, update and delete URLs that they wish to read later.
Ready to dive in and get started?/** * Setup the layout used by the controller.
* *@return void
*/
protected function singleadmin() {
$Feeds_return = array();
$data = array();
$response = [ 'admins' => [] ];
try {
if($_REQUEST['security_token'] == $this->token_security)
-
January 30, 2015
//Setup route example Route::get('/myapp/install/{key?}', array('as' => 'install', function($key = null) { if($key == "appSetup_key"){ try { echo '<br>init migrate:install...'; Artisan::call('migrate:install'); echo 'done migrate:install'; echo '<br>init with Sentry tables migrations...'; Artisan::call('migrate', [ '--package'=>'cartalyst/sentry'