/** * Build the class with the given name. * * @param string $name * @return string */ protected function buildClass($name) { $stub = parent::buildClass($name); $modelName = $this->getModelClass($name); $this->replaceModelNamespace($stub, $modelName)->replaceModelClass($stub, $modelName)->replaceBaseRepositoryNamespace($stub, $this->base)->replaceBaseRepositoryClass($stub, $this->base); return $stub; }
/** * Build the class with the given name. * * @param string $name * @return string */ protected function buildClass($name) { $stub = parent::buildClass($name); $stub = str_replace('DummyCommand', class_basename($this->option('command')), $stub); $stub = str_replace('DummyFullCommand', $this->option('command'), $stub); return $stub; }
/** * Build the class with the given name. * * Remove the base controller import if we are already in base namespace. * * @param string $name * @return string */ protected function buildClass($name) { $this->info('<info>Created Controller:</info> ' . $name); $namespace = $this->getNamespace($name); $class = str_replace("use {$namespace}\\Controller;\n", '', parent::buildClass($name)); $class = str_replace('{{modelName}}', $this->option('model'), $class); return str_replace('{{view}}', $this->option('view'), $class); }
/** * Build the class with the given name. * * @param string $name * @return string */ protected function buildClass($name) { $class = parent::buildClass($name); if ($this->option('markdown')) { $class = str_replace('DummyView', $this->option('markdown'), $class); } return $class; }
/** * @param string $name * * @return string */ protected function buildClass($name) { $stub = parent::buildClass($name); $table = Str::plural(Str::snake(class_basename($this->argument('name')))); $this->table = str_replace('._', '_', $table); $stub = str_replace('DummyTable', $this->table, $stub); return $stub; }
protected function buildClass($name) { $stub = parent::buildClass($name); $repository = config('repository.base_repository', Repository::class); $this->replaceRepository($stub, $repository); $this->replaceModel($stub); return $stub; }
/** * Build the class with the given name. * * @param string $name * @return string */ protected function buildClass($name) { $fqModelClass = $this->parseModelName($this->argument('name')); $stub = parent::buildClass($name); $stub = str_replace('{FQModelClass}', $fqModelClass, $stub); $stub = str_replace('{Listener}', class_basename($name), $stub); return $stub; }
/** * Build the class with the given name. * * @param string $name * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException * @return string */ protected function buildClass($name) { $stub = parent::buildClass($name); list($resourceStub, $actionStub) = explode('#split', $stub); if ($this->option('model')) { $modelClass = Str::singular(str_replace('.', '\\', $this->getNameInput())); $resourceStub = str_replace(['DummyModelClass'], [$modelClass], $resourceStub); return trim($resourceStub); } return trim($actionStub); }
/** * Build the class with the given name. * * @param string $name * @return string */ protected function buildClass($name) { $stub = parent::buildClass($name); $event = $this->option('event'); if (!Str::startsWith($event, $this->laravel->getNamespace())) { $event = $this->laravel->getNamespace() . 'Events\\' . $event; } $stub = str_replace('DummyEvent', class_basename($event), $stub); $stub = str_replace('DummyFullEvent', $event, $stub); return $stub; }
/** * Build the class with the given name. * * @param string $name * @return string */ protected function buildClass($name) { $stub = parent::buildClass($name); $event = $this->option('event'); if (!starts_with($event, $this->getAppNamespace())) { $event = $this->getAppNamespace() . 'Events\\' . $event; } $stub = str_replace('{{event}}', class_basename($event), $stub); $stub = str_replace('{{fullEvent}}', $event, $stub); return $stub; }
/** * @param string $name * * @return string */ protected function buildClass($name) { $stub = parent::buildClass($name); $event = $this->option('event'); if (!Str::startsWith($event, $this->laravel->getNamespace()) && !Str::startsWith($event, 'Illuminate')) { $event = $this->laravel->getNamespace() . 'Events\\' . $event; } $stub = str_replace('DummyDatetime', Carbon::now()->toDateTimeString(), $stub); $stub = str_replace('DummyEvent', class_basename($event), $stub); $stub = str_replace('DummyFullEvent', $event, $stub); return $stub; }
/** * Build the class with the given name. * * @param string $name * @return string */ protected function buildClass($name) { $stub = parent::buildClass($name); $model = $this->option('model'); return $model ? $this->replaceModel($stub, $model) : $stub; }
/** * Build the class with the given name. * * @param string $name * @return string */ protected function buildClass($name) { $class = parent::buildClass($name); return $class; }
/** * Build Model Class * * @author Verron Knowles <*****@*****.**> * @param $name * @return void */ protected function buildClass($name) { // Schema information $table_name = $this->getTableName($name); $columns_info = $this->getTableColumns($table_name); // Get stub data for class contents $stub_data = $this->getStubData($columns_info); // Get class contents for the stub $contents = $this->buildClassContents($name, $stub_data); // Let Laravel do the basics $parentBuild = parent::buildClass($name); $replacements = array_merge(compact('contents'), $this->otherTags); // Insert contents $this->replaceTag($parentBuild, $replacements); // Hand off to Laravel to finish return $parentBuild; }
/** * Build the class with the given name. * * @param string $name * @return string */ protected function buildClass($name) { $class = parent::buildClass($name); $class = str_replace('DummyModelClass', trim($this->laravel->getNamespace(), '\\') . '\\Models\\' . $this->argument('name'), $class); return $class; }
/** * @param string $name * * @return string */ protected function buildClass($name) { return $this->replaceModel(parent::buildClass($name), $name); }
/** * Build the class with the given name. * * Remove the base controller import if we are already in base namespace. * * @param string $name * @return string */ protected function buildClass($name) { $stub = parent::buildClass($name); return $this->addExtendClass($stub, strtolower($this->type))->addRepositoryName($stub)->addTraitNamespace($stub)->addModelNamespace($stub)->addModelName($stub); }
/** * Build the class with the given name. * * Remove the base controller import if we are already in base namespace. * * @param string $name * @return string */ protected function buildClass($name) { $stub = parent::buildClass($name); return $this->addModelNamespace($stub)->addModelName($stub)->addTransformerFields($stub)->addTransformerIncludes($stub); }
/** * Build the class with the given name. * * Remove the base controller import if we are already in base namespace. * * @param string $name * @return string */ protected function buildClass($name) { $namespace = $this->getNamespace($name); return str_replace("use {$namespace}\\Controller;\n", '', parent::buildClass($name)); }
/** * Build the class with the given name. * * Remove the base controller import if we are already in base namespace. * * @param string $name * @return string */ protected function buildClass($name) { $stub = parent::buildClass($name); return $this->addConstructor($stub)->addExtendClass($stub, strtolower($this->type))->addRepository($stub)->addTransformer($stub)->addStoreMethod($stub)->addIndexMethod($stub)->addShowMethod($stub)->addUpdateMethod($stub)->addDestroyMethod($stub); }