File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/Kris/LaravelFormBuilder/Fields Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -406,7 +406,7 @@ protected function normalizeRules($rules)
406406 *
407407 * @param array $first first set of rules
408408 * @param array $second second set of rules
409- * @return array merged set of rules without duplicates
409+ * @return array merged set of rules without duplicates
410410 */
411411 protected function mergeRules ($ first , $ second )
412412 {
@@ -672,12 +672,16 @@ protected function addErrorClass()
672672 */
673673 protected function setDefaultOptions (array $ options = [])
674674 {
675+ // Get default defaults from config (eg. defaults.field_class)
675676 $ this ->options = $ this ->formHelper ->mergeOptions ($ this ->allDefaults (), $ this ->getDefaults ());
676- $ this ->options = $ this ->prepareOptions ($ options );
677677
678+ // Maybe overwrite with field type defaults from config (eg. defaults, checkbox, field_class)
678679 $ defaults = $ this ->setDefaultClasses ($ options );
679680 $ this ->options = $ this ->formHelper ->mergeOptions ($ this ->options , $ defaults );
680681
682+ // Add specific field classes (eg. attr.class_append)
683+ $ this ->options = $ this ->prepareOptions ($ options );
684+
681685 $ this ->setupLabel ();
682686 }
683687
You can’t perform that action at this time.
0 commit comments