From a6d6e9cc104c4b374bbdc60f144f456071188c6c Mon Sep 17 00:00:00 2001 From: dishereandy <47082080+dishereandy@users.noreply.github.com> Date: Mon, 25 May 2020 04:29:41 +0630 Subject: [PATCH 1/2] Update ControllerLexer.php --- src/Lexers/ControllerLexer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Lexers/ControllerLexer.php b/src/Lexers/ControllerLexer.php index d18e1c60..06e60423 100644 --- a/src/Lexers/ControllerLexer.php +++ b/src/Lexers/ControllerLexer.php @@ -31,8 +31,10 @@ public function analyze(array $tokens): array if (isset($definition['resource'])) { $resource_definition = $this->generateResourceTokens($controller, $this->methodsForResource($definition['resource'])); + + // Checks if resource is prefixed with API - if ($definition['resource'] === 'api') { + if (Str::startsWith(Str::lower($definition['resource']),'api') { $controller->setApiResource(true); } From 7e2a4a5b95fb247417124a1008bb299803e87f88 Mon Sep 17 00:00:00 2001 From: dishereandy <47082080+dishereandy@users.noreply.github.com> Date: Mon, 25 May 2020 04:36:34 +0630 Subject: [PATCH 2/2] Update ControllerLexer.php --- src/Lexers/ControllerLexer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Lexers/ControllerLexer.php b/src/Lexers/ControllerLexer.php index 06e60423..b5bf5cc4 100644 --- a/src/Lexers/ControllerLexer.php +++ b/src/Lexers/ControllerLexer.php @@ -34,7 +34,7 @@ public function analyze(array $tokens): array // Checks if resource is prefixed with API - if (Str::startsWith(Str::lower($definition['resource']),'api') { + if (Str::startsWith(Str::lower($definition['resource']),'api')) { $controller->setApiResource(true); }