/** * @param string $content * @param string $formClass * * @return string */ protected function addFormMethodToController($content, $formClass) { if (!Str::contains($content, "function {$formClass}(")) { $methodStub = $this->getFormMethodStub($formClass); $replacement = $methodStub . "\n}"; if ($methodStub) { $content = Str::replaceLast('}', $replacement, $content); } } return $content; }
/** * Gets the Classname to generate from the called class like * MakeDataObjectCommand => DataObject class * MakeFormCommand => Form class. * * @return string */ public function getCommandClass() { $class = get_class($this); $class = Str::replaceFirst('Make', '', $class); $class = Str::replaceLast('Command', '', $class); return $class; }