PHP code example of fitzage / optimus-bard

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

    

fitzage / optimus-bard example snippets


use Fitzage\OptimusBard\TransformBard;

'field_name' => function ($field_name) {
    return TransformBard::transform($field_name, 'blueprint/path', 'field_name', ['set_type_1', 'set_type_2']);
},

'blog' => [
  'driver' => 'algolia',
  'searchables' => 'collection:blog',
  'fields' => ['title','description','body'],
  'transformers' => [
    'body' => function ($body) {
      return TransformBard::transform($body, 'collections/blog/article', 'body', ['columns', 'info_block']);
    },
  ]
],