PHP code example of marceli-to / statamic-sync

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

    

marceli-to / statamic-sync example snippets


// config/statamic-sync.php

return [
    // Shared secret for authentication ( (local side only)
    'remote' => env('STATAMIC_SYNC_REMOTE', ''),

    // Directories to sync (relative to project root)
    'paths' => [
        'content' => 'content',
        'assets' => 'public/assets',
    ],

    // URL prefix for the sync endpoint
    'route_prefix' => '_sync',

    // Optional IP whitelist (empty = allow all, token still 
bash
php artisan vendor:publish --tag=statamic-sync-config
bash
php artisan statamic:pull
bash
php artisan statamic:pull --only=content
bash
php artisan statamic:pull --only=assets
bash
php artisan statamic:pull --dry-run
bash
php artisan statamic:pull --full
bash
php artisan statamic:pull --force