diff --git a/src/FormBuilder.php b/src/FormBuilder.php index bf91e4a..4a4d9ff 100644 --- a/src/FormBuilder.php +++ b/src/FormBuilder.php @@ -1224,16 +1224,12 @@ class FormBuilder */ public function __call($method, $parameters) { - try { + if (static::hasComponent($method)) { return $this->componentCall($method, $parameters); - } catch (BadMethodCallException $e) { - // } - try { + if (static::hasMacro($method)) { return $this->macroCall($method, $parameters); - } catch (BadMethodCallException $e) { - // } throw new BadMethodCallException("Method {$method} does not exist."); diff --git a/src/HtmlBuilder.php b/src/HtmlBuilder.php index 00562b6..6dc3a30 100755 --- a/src/HtmlBuilder.php +++ b/src/HtmlBuilder.php @@ -553,16 +553,12 @@ class HtmlBuilder */ public function __call($method, $parameters) { - try { + if (static::hasComponent($method)) { return $this->componentCall($method, $parameters); - } catch (BadMethodCallException $e) { - // } - try { + if (static::hasMacro($method)) { return $this->macroCall($method, $parameters); - } catch (BadMethodCallException $e) { - // } throw new BadMethodCallException("Method {$method} does not exist.");