Caffeinated\Modules\Console\GeneratorCommand::getPath PHP Method

getPath() protected method

Get the destination class path.
protected getPath ( string $name ) : string
$name string
return string
    protected function getPath($name)
    {
        $slug = $this->argument('slug');
        // take everything after the module name in the given path (ignoring case)
        $key = array_search(strtolower($slug), explode('\\', strtolower($name)));
        if ($key === false) {
            $newPath = str_replace('\\', '/', $name);
        } else {
            $newPath = implode('/', array_slice(explode('\\', $name), $key + 1));
        }
        return module_path($slug, "{$newPath}.php");
    }
GeneratorCommand