public function handle() { $name = $this->ask('Directory name'); $displayName = $this->ask('Display name'); $name = Str::slugify($name); $this->generate($name, ['config.php.stub' => 'config.php'], ['displayName' => $displayName]); $this->comment('All done sire!'); }
protected function write($content, $name = null) { $tmpDir = storage_path('blade-extensions'); if (!$this->files->exists($tmpDir)) { $this->files->makeDirectory($tmpDir); } if (is_null($name)) { $name = Str::slugify($this->viewPath) . '__' . uniqid(time(), true); } $path = Path::join($tmpDir, $name); $this->files->put($path, $content); return [$name, $path]; }