public static function createRouteFile(string $slug, $controller = 'PostController')
    {
        $stub =  File::get(stubPath('PostType'));
        $route = str_replace('DummySlug', cleanPostTypeSlug($slug), $stub);
        $route = str_replace('DummyController', $controller, $route);
        $bytes_written = File::put(base_path().'/routes/'.$slug.'.php', $route);
        if ($bytes_written === false) {
            die("Error writing to new route file");
        }
        return $route;
    }
public static function createRouteFile(string $slug, $controller = 'PostController')
    {
        $stub =  File::get(stubPath('PostType'));
        $route = str_replace('DummySlug', cleanPostTypeSlug($slug), $stub);
        $route = str_replace('DummyController', $controller, $route);
        $bytes_written = File::put(base_path().'/routes/'.$slug.'.php', $route);
        if ($bytes_written === false) {
            die("Error writing to new route file");
        }
        return $route;
    }
public static function createRouteFile ( string $ slug , $ controller = 'PostController' ) { $ stub = File :: get ( stubPath ( 'PostType' ) ) ; $ route = str_replace ( 'DummySlug' , cleanPostTypeSlug ( $ slug ) , $ stub ) ; $ route = str_replace ( 'DummyController' , $ controller , $ route ) ; $ bytes_written = File :: put ( base_path ( ) . '/routes/' . $ slug . '.php' , $ route ) ; if ( $ bytes_written === false ) { die ( "Error writing to new route file" ) ; } return $ route ; }
Creates route file for new post types.

@param  string $slug
@return mixed
Creates route file for new post types .