Skip to content

Commit 881e7f6

Browse files
committed
Only add classes to actual Fields
1 parent 3337c01 commit 881e7f6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Former/Former.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
namespace Former;
33

44
use Closure;
5+
use Former\Traits\Field;
56
use Illuminate\Container\Container;
6-
use Illuminate\Validation\Validator;
77
use Illuminate\Support\MessageBag;
8+
use Illuminate\Validation\Validator;
89

910
/**
1011
* Helps the user interact with the various Former components
@@ -139,7 +140,10 @@ public function __call($method, $parameters)
139140
// Dispatch to the different Form\Fields
140141
$framework = isset($this->app['former.form.framework']) ? $this->app['former.form.framework'] : $this->app['former.framework'];
141142
$field = $this->dispatch->toFields($method, $parameters);
142-
$field = $framework->getFieldClasses($field, $classes);
143+
144+
if ($field instanceof Field) {
145+
$field = $framework->getFieldClasses($field, $classes);
146+
}
143147

144148
// Else bind field
145149
$this->app->instance('former.field', $field);

0 commit comments

Comments
 (0)