Skip to content

Commit a31cfb7

Browse files
Merge pull request #302 from Cryborg/add_sort_groupby_to_command
Add sort & groupby to export command
2 parents 3307679 + e051236 commit a31cfb7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Commands/ExportRequestDocsCommand.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ public function __construct(LaravelRequestDocs $laravelRequestDoc, LaravelReques
2929
*/
3030
protected $signature = 'laravel-request-docs:export
3131
{path? : Export file location}
32+
{--sort=default : Sort the data by route names}
33+
{--groupby=default : Group the data by API URI}
3234
{--force : Whether to overwrite existing file}';
3335

36+
3437
/**
3538
* The console command description.
3639
*
@@ -75,8 +78,8 @@ public function handle()
7578

7679
// Loop and split Doc by the `methods` property.
7780
$docs = $this->laravelRequestDocs->splitByMethods($docs);
78-
$docs = $this->laravelRequestDocs->sortDocs($docs, 'default');
79-
$docs = $this->laravelRequestDocs->groupDocs($docs, 'default');
81+
$docs = $this->laravelRequestDocs->sortDocs($docs, $this->option('sort'));
82+
$docs = $this->laravelRequestDocs->groupDocs($docs, $this->option('groupby'));
8083

8184
if (!$this->writeApiDocsToFile($docs)) {
8285
throw new ErrorException("Failed to write on [{$this->exportFilePath}] file.");

0 commit comments

Comments
 (0)