PHP code example of sule / api

1. Go to this page and download the library: Download sule/api 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/ */

    

sule / api example snippets


Route::get('api/v1/users', array(
    'before' => array(
        'api.oauth:read'
    ), function() {

    }
));

Route::post('api/v1/users', array(
    'before' => array(
        'api.content.md5', 
        'api.oauth:write'
    ), function() {

    }
));

Route::post('api/v1/users', array(
    'before' => array(
        'api.ua.

    }
));

Route::post('api/v1/users', array(
    'before' => array(
        'api.ua.e'
    ), function() {

    }
));

return API::resourceJson($data = array(), $status = 200, array $headers = array());

return API::collectionJson($data = array(), $status = 200, array $headers = array());

'API'             => 'Sule\Api\Facades\API'

php artisan config:publish sule/api