From a99919b1c6f5dadc0b1c9f15cc6ca48d787d2357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ka=CC=88llstrand=20Modig?= Date: Thu, 25 Feb 2021 23:59:05 +0100 Subject: [PATCH] After more consideration, this shouldn't be optional. No items should be generated in collection if the route points to a missing method. Maybe issuing a warning? --- config/api-postman.php | 9 --------- src/Commands/ExportPostmanCommand.php | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/config/api-postman.php b/config/api-postman.php index 089cf3f..80372c8 100644 --- a/config/api-postman.php +++ b/config/api-postman.php @@ -86,13 +86,4 @@ * Specify the configured disk for storing the postman collection file. */ 'disk' => 'local', - - /* - * Generate for available controller methods only - * - * Forces generation to only generate items for actual methods instead of all the - * standard scaffolded ones. Useful for API resources where form routes are not used. - */ - 'available_methods_only' => true, - ]; diff --git a/src/Commands/ExportPostmanCommand.php b/src/Commands/ExportPostmanCommand.php index 9de5008..165ac38 100644 --- a/src/Commands/ExportPostmanCommand.php +++ b/src/Commands/ExportPostmanCommand.php @@ -150,7 +150,7 @@ protected function getReflectionMethod(array $routeAction): ?object $routeData = explode('@', $routeAction['uses']); $reflection = new ReflectionClass($routeData[0]); - if ($this->config['available_methods_only'] && ! $reflection->hasMethod($routeData[1])) { + if (! $reflection->hasMethod($routeData[1])) { return null; }