JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbrstub(), [ 'NAMESPACE' => $this->getClassNamespace($this->module()), 'CLASS' => $this->typeClass(), ]))->render(); } public function stub(): string { return $this->option('invokable') ? '/class-invoke.stub' : '/class.stub'; } public function getDestinationFilePath(): string { $path = $this->laravel['modules']->getModulePath($this->getModuleName()); $filePath = GenerateConfigReader::read('class')->getPath() ?? config('modules.paths.app_folder').'Classes'; return $this->typePath($path.$filePath.'/'.$this->getFileName().'.php'); } protected function getFileName(): string { $file = Str::studly($this->argument('name')); if ($this->option('suffix') === true) { $names = [Str::plural($this->type()), Str::singular($this->type())]; $file = Str::of($file)->remove($names, false); $file .= Str::of($this->type())->studly(); } return $file; } /** * Get the type of class e.g. class, service, repository, etc. */ protected function type(): string { return Str::of($this->option('type'))->remove('=')->singular(); } protected function typePath(string $path): string { return ($this->type() === 'class') ? $path : Str::of($path)->replaceLast('Classes', Str::of($this->type())->plural()->studly()); } public function typeClass(): string { return Str::of($this->getFileName())->basename()->studly(); } public function getDefaultNamespace(): string { $type = $this->type(); return config("modules.paths.generator.{$type}.namespace", 'Classes'); } }