PHP code example of doefom / statamic-export

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

    

doefom / statamic-export example snippets




return [
    /*
    |--------------------------------------------------------------------------
    | Fieldtype Mappings
    |--------------------------------------------------------------------------
    |
    | Define custom mappings for how specific fieldtypes should be converted to
    | strings during export. Each key should be the fully qualified class name
    | of the fieldtype, and the value should be a closure that receives the
    | field value and returns a string.
    |
    */
    'fieldtype_mappings' => [
        \Custom\Fieldtype::class => function (\Statamic\Fields\Value $value) {
            // ... do something with the value ...
            return (string) $transformedValue;
        },
    ],
];