Skip to content

Commit

Permalink
After more consideration, this shouldn't be optional. No items should…
Browse files Browse the repository at this point in the history
… be generated in collection if the route points to a missing method. Maybe issuing a warning?
  • Loading branch information
Daniel Källstrand Modig committed Feb 25, 2021
1 parent 3964d75 commit a99919b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions config/api-postman.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,

];
2 changes: 1 addition & 1 deletion src/Commands/ExportPostmanCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a99919b

Please sign in to comment.