Templates
If you want to modify templates, make sure they have similar structure to this: views
Globally changing paths to templates is available in the configuration config.php file.
<?php
return [
// ...
'checkbox' => 'posts.my-custom-checkbox' // resources/views/posts/my-custom-checkbox.blade.php
];
One more way to change template is directly from Form class:
<?php namespace App\Forms;
use Kris\LaravelFormBuilder\Form;
class PostForm extends Form
{
public function buildForm()
{
// Change the form template (default from form.php)
$this->setFormOption('template', 'posts.form'); // resources/views/posts/form.blade.php
// Change a field's template
$this
->add('title', 'text')
->add('body', 'textearea', [
'template' => 'posts.textarea' // resources/views/posts/textarea.blade.php
]);
}
}
When you are adding custom templates make sure they inherit functionality from defaults to prevent breaking.