]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Request.php
respective book and chapter structure added.
[bookstack] / app / Http / Request.php
index fa368f3bca96fa829095c75a12a11dae8c42b8e4..c2d430279fb08db23f91b3ec06574d9e6bf21f46 100644 (file)
@@ -9,10 +9,8 @@ class Request extends LaravelRequest
     /**
      * Override the default request methods to get the scheme and host
      * to directly use the custom APP_URL, if set.
-     *
-     * @return string
      */
-    public function getSchemeAndHttpHost()
+    public function getSchemeAndHttpHost(): string
     {
         $appUrl = config('app.url', null);
 
@@ -27,15 +25,14 @@ class Request extends LaravelRequest
      * Override the default request methods to get the base URL
      * to directly use the custom APP_URL, if set.
      * The base URL never ends with a / but should start with one if not empty.
-     *
-     * @return string
      */
-    public function getBaseUrl()
+    public function getBaseUrl(): string
     {
         $appUrl = config('app.url', null);
 
         if ($appUrl) {
             $parsedBaseUrl = rtrim(implode('/', array_slice(explode('/', $appUrl), 3)), '/');
+
             return empty($parsedBaseUrl) ? '' : ('/' . $parsedBaseUrl);
         }