public function make($path, $name, array $options = [])
    {
        $options += ['middleware' => null, 'prefix' => null];

        $parsedRoutes = $this->getParsedRoutes($options['middleware'], $options['prefix']);

        $template = $this->file->get(__DIR__ . '/templates/Router.js');

        $template = str_replace("routes: null,", 'routes: ' . json_encode($parsedRoutes) . ',', $template);
        $template = str_replace("'Router'", "'" . $options['object'] . "'", $template);

        if ($this->file->isWritable($path)) {
            $filename = $path . '/' . $name;

            return $this->file->put($filename, $template) !== false;
        }

        return false;
    }
public function make($path, $name, array $options = [])
    {
        $options += ['middleware' => null, 'prefix' => null];

        $parsedRoutes = $this->getParsedRoutes($options['middleware'], $options['prefix']);

        $template = $this->file->get(__DIR__ . '/templates/Router.js');

        $template = str_replace("routes: null,", 'routes: ' . json_encode($parsedRoutes) . ',', $template);
        $template = str_replace("'Router'", "'" . $options['object'] . "'", $template);

        if ($this->file->isWritable($path)) {
            $filename = $path . '/' . $name;

            return $this->file->put($filename, $template) !== false;
        }

        return false;
    }
public function make ( $ path , $ name , array $ options = [ ] ) { $ options += [ 'middleware' => null , 'prefix' => null ] ; $ parsedRoutes = $ this -> getParsedRoutes ( $ options [ 'middleware' ] , $ options [ 'prefix' ] ) ; $ template = $ this -> file -> get ( __DIR__ . '/templates/Router.js' ) ; $ template = str_replace ( "routes: null," , 'routes: ' . json_encode ( $ parsedRoutes ) . ',' , $ template ) ; $ template = str_replace ( "'Router'" , "'" . $ options [ 'object' ] . "'" , $ template ) ; if ( $ this -> file -> isWritable ( $ path ) ) { $ filename = $ path . '/' . $ name ; return $ this -> file -> put ( $ filename , $ template ) !== false ; } return false ; }
Compile routes template and generate

@param  string $path
@param  string $name
@param  array  $options

@return bool
Compile routes template and generate