argument('name'); $this->info( Str::plural(Str::studly($name))); // $this->controller($name); } protected function getStub($path) { return file_get_contents(app_path('Stubs/Controller/Controller.stub')); } protected function controller($name) { $template = str_replace([ '{{categoryNameStudlyCasePlural}}', '{{type}}', '{{modelNameStudlyCasePlural}}' ], [ Str::plural(Str::studly('Account')), 'lists', Str::plural(Str::studly($name)) ], $this->getStub('')); file_put_contents(app_path('/Http/Controllers/TestGeneratedController.php'), $template); } }