PHP code example of sanity / silex-service-provider

1. Go to this page and download the library: Download sanity/silex-service-provider 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/ */

    

sanity / silex-service-provider example snippets



$app = new Silex\Application();
$app->register(new Sanity\Silex\ServiceProvider(), [
    'sanity.client.options' => [
        'projectId' => '<project id>', // 

$apiClient = $app['sanity.client'];