Skip to content

Commit 9e2a042

Browse files
author
Katalam
committed
Adding the ability to have route parameters
1 parent 2c9b59e commit 9e2a042

File tree

4 files changed

+4
-23
lines changed

4 files changed

+4
-23
lines changed

composer.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"autoload": {
3636
"psr-4": {
3737
"Hyperlink\\JsonStructure\\": "src",
38-
"Hyperlink\\JsonStructure\\Database\\Factories\\": "database/factories"
3938
}
4039
},
4140
"autoload-dev": {
@@ -62,11 +61,8 @@
6261
"providers": [
6362
"Hyperlink\\JsonStructure\\JsonStructureServiceProvider"
6463
],
65-
"aliases": {
66-
"JsonStructure": "Hyperlink\\JsonStructure\\Facades\\JsonStructure"
67-
}
6864
}
6965
},
7066
"minimum-stability": "dev",
7167
"prefer-stable": true
72-
}
68+
}

src/Commands/JsonStructureCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
class JsonStructureCommand extends Command
1111
{
1212
public $signature = 'json:structure
13-
{endpoint? : The api route name to get the json structure from}';
13+
{endpoint? : The api route name to get the json structure from}
14+
{parameter?* : The parameters to pass to the endpoint}';
1415
// {array?* : The array to get the json structure from}';
1516

1617
public $description = 'Converts a json structure to an array with the json keys';
@@ -21,7 +22,7 @@ public function handle(): int
2122

2223
// if ($this->argument('endpoint')) {
2324
$this->info('Getting json structure from endpoint...');
24-
$response = Http::get(route($this->argument('endpoint')));
25+
$response = Http::get(route($this->argument('endpoint'), $this->argument('parameter')));
2526

2627
if ($response->failed()) {
2728
$this->error('Could not get json structure from endpoint');

src/Facades/.gitkeep

Whitespace-only changes.

src/Facades/JsonStructure.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)