PHP code example of padosoft / migrate-cloudflare-rules

1. Go to this page and download the library: Download padosoft/migrate-cloudflare-rules 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/ */

    

padosoft / migrate-cloudflare-rules example snippets


return [
    App\Providers\AppServiceProvider::class,
    Padosoft\MigrateCloudflareRules\MigrateCloudflareRulesServiceProvider::class,
];

return [
    'source' => [
        'api_token'  => env('CLOUDFLARE_MIGRATE_SOURCE_API_TOKEN'),
        'account_id' => env('CLOUDFLARE_MIGRATE_SOURCE_ACCOUNT_ID'),
        'zone_id'    => env('CLOUDFLARE_MIGRATE_SOURCE_ZONE_ID'),
    ],
    'destination' => [
        'api_token'  => env('CLOUDFLARE_MIGRATE_DESTINATION_API_TOKEN'),
        'account_id' => env('CLOUDFLARE_MIGRATE_DESTINATION_ACCOUNT_ID'),
        'zone_id'    => env('CLOUDFLARE_MIGRATE_DESTINATION_ZONE_ID'),
    ],
];
bash
php artisan vendor:publish --tag=migrate-cloudflare-rules-config
bash
   php artisan cloudflare:migrate waf individual --dryrun
   
bash
   php artisan cloudflare:migrate waf individual
   
bash
php artisan cloudflare:migrate waf bulk
bash
php artisan cloudflare:migrate waf individual --exclude=372e67954025e0ba6aaa6d586b9e0b59 --exclude=8ff5c1d2e2b64ad4a3d3ffb1a1c9d7e0
bash
php artisan cloudflare:migrate waf individual --only_rules_id=372e67954025e0ba6aaa6d586b9e0b59 --only_rules_id=8ff5c1d2e2b64ad4a3d3ffb1a1c9d7e0
bash
php artisan cloudflare:migrate ipaccessrulesaccount bulk
bash
php artisan cloudflare:migrate ipaccessruleszone individual --exclude=92f17202ed8bd63d69a66b86a49a8f6b
bash
php artisan cloudflare:migrate useragent bulk
bash
php artisan cloudflare:migrate ratelimit bulk
bash
php artisan cloudflare:migrate customlists individual
php artisan cloudflare:migrate customlists individual --only_rules_id=office_ips --only_rules_id=partners
bash
php artisan cloudflare:migrate ipaccessruleszone bulk --dryrun --debug