PHP code example of tigerheck / laravel-restapi

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

    

tigerheck / laravel-restapi example snippets

bash
$ php artisan vendor:publish --provider="TigerHeck\RestApi\RestApiServiceProvider"

RESTAPI_BASE_URL=
RESTAPI_CLIENT_ID=
RESTAPI_SECRET_ID=
RESTAPI_URL_ACCESS_TOKEN="/connect/token"
RESTAPI_SCOPES="********"
RESTAPI_GRANT_TYPE="client_credentials"

$response = app("restapi")->http()->put("/api/post/url/{$id}", [
    'data1'             => $data1,
    'data2'             => $data2,
    'data3'             => $data3,
]);

$response = app("restapi")->http()->delete("/api/delete/url/{$id}");