code: public static function addBackSlash($uri, $position = 'end')
      {
          switch ($position) {
              case 'top':
                  $uri = '/' . ltrim($uri, '/');
                  break;
              case 'end':
                  $uri = rtrim($uri, '/') . '/';
                  break;
              case 'both':
                  $uri = ! empty($uri) ? '/' . trim($uri, '/') . '/' : '';
                  break;
              default:
                  $uri = false;
          }
  
          return $uri;
      }
docs: Add backslash if it does not exist at the end of the route.
  
  @param string $uri      → URI
  @param string $position → place where the backslash is placed
  
  @return string|false → path/url/ | /path/url | /path/url/