From c9384a32b5335979b79f30e87bba8d442cc7aa7c Mon Sep 17 00:00:00 2001 From: lrobt97 <69146855+lrobt97@users.noreply.github.com> Date: Wed, 12 Aug 2020 23:09:47 +0100 Subject: [PATCH] updating urls --- src/SWAPI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SWAPI.php b/src/SWAPI.php index a62518c..4cbc94a 100644 --- a/src/SWAPI.php +++ b/src/SWAPI.php @@ -30,7 +30,7 @@ public function __construct() protected function createHttpClient() { return new Client([ - 'base_url' => 'http://swapi.co/api/', + 'base_url' => 'https://swapi.dev/api/', 'default' => [ 'exceptions' => false, 'headers' => [ @@ -137,7 +137,7 @@ public function getFromUri($uri) { if (preg_match("/\/api\/(\w+)\/(\d+)(\/|$)/", $uri, $matches) !== false) { switch (strtolower($matches[1])) { - case "characters": + case "people": return $this->characters()->get($matches[2]); case "films": return $this->films()->get($matches[2]);