🔒 Persist Trakt authentication tokens to config JSON file
This commit is contained in:
parent
f19afc41f0
commit
dd7196572c
4 changed files with 17 additions and 3 deletions
|
|
@ -6,13 +6,14 @@ namespace App\Commands;
|
|||
|
||||
use App\Services\Trakt;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
|
||||
class TraktDebug extends Command
|
||||
{
|
||||
protected $signature = 'trakt:debug {endpoint : Trakt API endpoint to call} {method=GET : HTTP method to use} {--d|data=* : data}';
|
||||
protected $description = 'Make arbitrary requests to Trakt API.' . PHP_EOL . '-d should be formatted with key=value or key:=value for non-strings';
|
||||
|
||||
public function handle(Trakt $trakt): int
|
||||
public function handle(Trakt $trakt, Repository $config): int
|
||||
{
|
||||
$body = $this->getBody();
|
||||
$method = $this->argument('method');
|
||||
|
|
@ -28,6 +29,8 @@ class TraktDebug extends Command
|
|||
$resp = $resp->send($method, $url);
|
||||
$this->line('Response (' . $resp->status() . '):' . PHP_EOL . json_encode($resp->json(), JSON_PRETTY_PRINT));
|
||||
|
||||
$this->line('Config: ' . json_encode($config->get('trakt')));
|
||||
|
||||
return static::SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue