original_string: protected function provideAPIRoutes()
      {
          $routes = Cache::rememberForever('provideAPIRoutes', function () {
              $router = app(Router::class);
              $routes = [];
              foreach ($router->getRoutes() as $collection) {
                  foreach ($collection->getRoutes() as $route) {
                      $temp = &$routes;
                      if ($routeName = $route->getName()) {
                          foreach (explode('.', $routeName) as $key) {
                              $temp = &$temp[$key];
                          }
                          $temp = preg_replace('/{(\w+)}/', ':$1', $route->uri());
                      }
                  }
              }
  
              return $routes['api'];
          });
  
          JavaScript::put(['api' => $routes]);
      }
code: protected function provideAPIRoutes()
      {
          $routes = Cache::rememberForever('provideAPIRoutes', function () {
              $router = app(Router::class);
              $routes = [];
              foreach ($router->getRoutes() as $collection) {
                  foreach ($collection->getRoutes() as $route) {
                      $temp = &$routes;
                      if ($routeName = $route->getName()) {
                          foreach (explode('.', $routeName) as $key) {
                              $temp = &$temp[$key];
                          }
                          $temp = preg_replace('/{(\w+)}/', ':$1', $route->uri());
                      }
                  }
              }
  
              return $routes['api'];
          });
  
          JavaScript::put(['api' => $routes]);
      }
code_tokens: protected function provideAPIRoutes ( ) { $ routes = Cache :: rememberForever ( 'provideAPIRoutes' , function ( ) { $ router = app ( Router :: class ) ; $ routes = [ ] ; foreach ( $ router -> getRoutes ( ) as $ collection ) { foreach ( $ collection -> getRoutes ( ) as $ route ) { $ temp = & $ routes ; if ( $ routeName = $ route -> getName ( ) ) { foreach ( explode ( '.' , $ routeName ) as $ key ) { $ temp = & $ temp [ $ key ] ; } $ temp = preg_replace ( '/{(\w+)}/' , ':$1' , $ route -> uri ( ) ) ; } } } return $ routes [ 'api' ] ; } ) ; JavaScript :: put ( [ 'api' => $ routes ] ) ; }
docstring: Provide all api routes as javascript variables.
docstring_tokens: Provide all api routes as javascript variables .