PHP code example of jacksleight / statamic-distill

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

    

jacksleight / statamic-distill example snippets


use JackSleight\StatamicDistill\Facades\Distill;

$youtubeVideoSets = Distill::query($value)
    ->type('set:video')
    ->where('url', 'like', '%youtube.com%')
    ->get();

use JackSleight\StatamicDistill\Facades\Distill;
use Statamic\Facades\Collection;
use Statamic\Statamic;

$value = $entry->augmentedValue('content');
$data = Distill::bard($value);

$value = $entry->augmentedValue('builder');
$text = Distill::text($value);

// config/statamic/search.php
'searchables' => [
    'distill:collection:pages:sections',
],
'fields' => ['heading'],

// app/Stills/Sections.php
namespace App\Stills;

use JackSleight\StatamicDistill\Stills\Still;

class Sections extends Still
{
    public function apply($query, $values)
    {
        $query->path('builder.*')->type('set:section');
    }
}