diff --git a/src/Request.php b/src/Request.php index 8c85720..6bd5e16 100644 --- a/src/Request.php +++ b/src/Request.php @@ -63,11 +63,23 @@ public function except(array $keys): mixed public function url(): string { - return '//' . $this->host() . $this->path(); + if (env("APP_SSL", false) == true) { + $protocol = 'https://'; + } else { + $protocol = 'http://'; + } + + return $protocol . $this->host() . $this->path(); } public function fullUrl(): string { - return '//' . $this->host() . $this->uri(); + if (env("APP_SSL", false) == true) { + $protocol = 'https://'; + } else { + $protocol = 'http://'; + } + + return $protocol . $this->host() . $this->uri(); } }