diff --git a/src/Commands/ExportRequestDocsCommand.php b/src/Commands/ExportRequestDocsCommand.php index c7913ce..a939af1 100644 --- a/src/Commands/ExportRequestDocsCommand.php +++ b/src/Commands/ExportRequestDocsCommand.php @@ -29,8 +29,11 @@ public function __construct(LaravelRequestDocs $laravelRequestDoc, LaravelReques */ protected $signature = 'laravel-request-docs:export {path? : Export file location} + {--sort=default : Sort the data by route names} + {--groupby=default : Group the data by API URI} {--force : Whether to overwrite existing file}'; + /** * The console command description. * @@ -75,8 +78,8 @@ public function handle() // Loop and split Doc by the `methods` property. $docs = $this->laravelRequestDocs->splitByMethods($docs); - $docs = $this->laravelRequestDocs->sortDocs($docs, 'default'); - $docs = $this->laravelRequestDocs->groupDocs($docs, 'default'); + $docs = $this->laravelRequestDocs->sortDocs($docs, $this->option('sort')); + $docs = $this->laravelRequestDocs->groupDocs($docs, $this->option('groupby')); if (!$this->writeApiDocsToFile($docs)) { throw new ErrorException("Failed to write on [{$this->exportFilePath}] file.");