PHP code example of gioppy / statamic-rest-client

1. Go to this page and download the library: Download gioppy/statamic-rest-client 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/ */

    

gioppy / statamic-rest-client example snippets


StatamicRestClient::make(...)
  ->where('featured', true)

StatamicRestClient::make(...)
  ->where('title', 'awesome', 'contains')

StatamicRestClient::make(...)
  ->sort(['one', '-two', 'three'])

StatamicRestClient::make(...)
  ->fields(['id', 'title', 'content'])

StatamicRestClient::make(...)
  ->paginate(5, 2)

StatamicRestClient::make(...)
  ->entries('collection')

StatamicRestClient::make(...)
  ->entry('collection', 'id')

StatamicRestClient::make(...)
  ->navigation('navigation_name')

StatamicRestClient::make(...)
  ->terms('taxonomy_name')

StatamicRestClient::make(...)
  ->term('taxonomy_name', 'taxonomy_slug')

StatamicRestClient::make(...)
  ->globals()

StatamicRestClient::make(...)
  ->global('handle')

StatamicRestClient::make(...)
  ->assets('container')

StatamicRestClient::make(...)
  ->asset('container', 'path')

StatamicRestClient::make(...)
  ->assetById('id')

StatamicRestClient::make(...)
  ->entries('collection')
  ->all()

StatamicRestClient::make(...)
  ->entries('collection')
  ->data()

StatamicRestClient::make(...)
  ->entries('collection')
  ->toCollection()

StatamicGlideRest::make($host)
  ->presets(['small', 'medium'])
  ->glide('container::path')
  ->data()