Skip to content

Commit dc02d03

Browse files
authored
Merge pull request #4 from hyperlinkgroup/route-parameter
Adding the ability to have route parameters
2 parents 2c9b59e + 2291bbc commit dc02d03

File tree

4 files changed

+6
-25
lines changed

4 files changed

+6
-25
lines changed

composer.json

+3-7
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
},
3535
"autoload": {
3636
"psr-4": {
37-
"Hyperlink\\JsonStructure\\": "src",
38-
"Hyperlink\\JsonStructure\\Database\\Factories\\": "database/factories"
37+
"Hyperlink\\JsonStructure\\": "src"
3938
}
4039
},
4140
"autoload-dev": {
@@ -61,12 +60,9 @@
6160
"laravel": {
6261
"providers": [
6362
"Hyperlink\\JsonStructure\\JsonStructureServiceProvider"
64-
],
65-
"aliases": {
66-
"JsonStructure": "Hyperlink\\JsonStructure\\Facades\\JsonStructure"
67-
}
63+
]
6864
}
6965
},
7066
"minimum-stability": "dev",
7167
"prefer-stable": true
72-
}
68+
}

src/Commands/JsonStructureCommand.php

+3-2
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

-16
This file was deleted.

0 commit comments

Comments
 (0)