Monthly Archives: January 2015

  1. Laravel 4: A Start at a RESTful API

    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.

    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)

    Read more »
  2. Run Artisan commands form route or controller

    //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'=>
    Read more »
Copyright © 2016 Samdoit Infotech. All rights reserved.