JustSteveKing / laravel-envoyer-sdk

A simple to use PHP class to work with the Laravel Envoyer API
MIT License
36 stars 15 forks source link

Support array in \JustSteveKing\Laravel\Envoyer\SDK\Resources\Environment::put #4

Closed ghost closed 3 years ago

ghost commented 3 years ago

To me I would think passing an array would be much easier. Now you have to pass each line as a separate argument, but you could use an array instead, limiting the amount of arguments passed to just 1 and make it easier to change multiple values.

So multiple changes could be passed like this:

$envoyer->environments->on('id-of-project')
    ->key('1234')->onServer(1, 2, 3)
    ->put([
       'key1' => 'value1',
       'key2' => 'value2',
       'key3' => 'value3',
    ])

Or like this:

$envoyer->environments->on('id-of-project')
    ->key('1234')->onServer(1, 2, 3)
    ->put([
       'key1=value1',
       'key2=value2',
       'key3=value3',
    ])
JustSteveKing commented 3 years ago

Thanks for the feedback @thatsalltheyare - however, when making an API request and dealing with something like this, the most natural way felt like an array of key values over a mix of key value stings stored in an array.

If you can think of a way to support both, I'd happily accept a PR but until then I'm closing this issue as it isn't an issue, it's the design of the package