Skip to content

Commit

Permalink
Merge pull request #4 from hyperlinkgroup/route-parameter
Browse files Browse the repository at this point in the history
Adding the ability to have route parameters
  • Loading branch information
Katalam authored Jan 23, 2023
2 parents 2c9b59e + 2291bbc commit dc02d03
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 25 deletions.
10 changes: 3 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
},
"autoload": {
"psr-4": {
"Hyperlink\\JsonStructure\\": "src",
"Hyperlink\\JsonStructure\\Database\\Factories\\": "database/factories"
"Hyperlink\\JsonStructure\\": "src"
}
},
"autoload-dev": {
Expand All @@ -61,12 +60,9 @@
"laravel": {
"providers": [
"Hyperlink\\JsonStructure\\JsonStructureServiceProvider"
],
"aliases": {
"JsonStructure": "Hyperlink\\JsonStructure\\Facades\\JsonStructure"
}
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
5 changes: 3 additions & 2 deletions src/Commands/JsonStructureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
class JsonStructureCommand extends Command
{
public $signature = 'json:structure
{endpoint? : The api route name to get the json structure from}';
{endpoint? : The api route name to get the json structure from}
{parameter?* : The parameters to pass to the endpoint}';
// {array?* : The array to get the json structure from}';

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

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

if ($response->failed()) {
$this->error('Could not get json structure from endpoint');
Expand Down
Empty file added src/Facades/.gitkeep
Empty file.
16 changes: 0 additions & 16 deletions src/Facades/JsonStructure.php

This file was deleted.

0 comments on commit dc02d03

Please sign in to comment.