protected function formatHelperName($helper) { $namespace = $this->app->getNamespace(); if (!Str::contains($helper, $namespace)) { $helper = $namespace . 'Helpers\\' . $helper; } return $helper; }
/** * Parse the name and format according to the root namespace. * * @param string $name * @return string */ protected function parseName($name) { $rootNamespace = $this->laravel->getNamespace(); if (Str::startsWith($name, $rootNamespace)) { return $name; } if (Str::contains($name, '/')) { $name = str_replace('/', '\\', $name); } return $this->parseName($this->getDefaultNamespace(trim($rootNamespace, '\\')) . '\\' . $name); }
/** * Replace the dummy root namespace of the stub class * * @param string $stub * @return string */ protected function replaceDummyRootNamespace($stub) { return str_replace('DummyRootNamespace', $this->laravel->getNamespace(), $stub); }