diff --git a/src/Generator.php b/src/Generator.php index 3a3e96c..c8340af 100755 --- a/src/Generator.php +++ b/src/Generator.php @@ -6,6 +6,7 @@ use Illuminate\Support\Str; use Illuminate\Routing\Route; use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Support\Facades\Log; class Generator { @@ -178,7 +179,13 @@ protected function getFormRules() $parsedAction = Str::parseCallback($this->action); - $reflector = (new ReflectionMethod($parsedAction[0], $parsedAction[1])); + try { + $reflector = new ReflectionMethod($parsedAction[0], $parsedAction[1]); + } catch (\ReflectionException $e) { + Log::info('Parsed Action:', $parsedAction); + Log::error('ReflectionException: ' . $e->getMessage()); + return false; + } $parameters = $reflector->getParameters(); $docComment = $reflector->getDocComment();