<?php

namespace Distilleries\LayoutManager\Forms;

use App\Helpers\StaticLabel;
use Distilleries\FormBuilder\FormValidator;

class TemplatableForm extends FormValidator
{
    public static $rules = [];

    public static $rules_update = null;

    public function buildForm()
    {
        $options =  [
            'templatable' => $this->model,
            'categories' => [],
            'custom-tags' => [],
        ];
        if (array_get($this->formOptions, 'categories')) {
            $options['categories'] = (array_pull($this->formOptions, 'categories'));
        }
        if (array_get($this->formOptions, 'custom-tags')) {
            $options['custom-tags'] = (array_pull($this->formOptions, 'custom-tags'));
        }
        $this
            ->add('templates', 'template', $options);
    }
}

<?php

namespace Distilleries\LayoutManager\Forms;

use App\Helpers\StaticLabel;
use Distilleries\FormBuilder\FormValidator;

class TemplatableForm extends FormValidator
{
    public static $rules = [];

    public static $rules_update = null;

    public function buildForm()
    {
        $options =  [
            'templatable' => $this->model,
            'categories' => [],
            'custom-tags' => [],
        ];
        if (array_get($this->formOptions, 'categories')) {
            $options['categories'] = $this->formOptions['categories'];
        }
        if (array_get($this->formOptions, 'templates')) {
            $options['templates'] = $this->formOptions['templates'];
        }
        if (array_get($this->formOptions, 'custom-tags')) {
            $options['custom-tags'] = $this->formOptions['custom-tags'];
        }
        $this
            ->add('templates', 'template', $options);
    }
}

Add possibility to override available templates list
Add possibility to override available templates list
