PHP code example of emran-alhaddad / statamic-content-sync

1. Go to this page and download the library: Download emran-alhaddad/statamic-content-sync 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/ */

    

emran-alhaddad / statamic-content-sync example snippets


return [
    'disk'   => env('CONTENT_SYNC_DISK', 'local'),
    'folder' => env('CONTENT_SYNC_FOLDER', 'sync'),
    'chunk'  => env('CONTENT_SYNC_CHUNK', 500),
];

  Statamic::script('content-sync', __DIR__.'/../resources/dist/js/content-sync.js');
  
bash
composer vendor:publish --tag=content-sync-config
php artisan statamic:stache:refresh && php artisan cache:clear
bash
php artisan content-sync:export \
  --type=collections \
  --handles=pages,news \
  --sites=english,arabic \
  --since="2025-01-01T00:00:00+03:00" \
  --out=staging-delta.json