PHP code example of sorskod / larasponse

1. Go to this page and download the library: Download sorskod/larasponse library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sorskod / larasponse example snippets


'providers' => array(
    // ...
    'Sorskod\Larasponse\LarasponseServiceProvider'
)


use Sorskod\Larasponse\Larasponse;

class UserController extends BaseController
{
    protected $response;

    public function __construct(Larasponse $response)
    {
        $this->response = $response;

        // The Fractal parseIncludes() is available to use here
        $this->response->parseIncludes(Input::get('n(User::all(), new UserTransformer(), 'users');
    }
}