/** * Add a noun to the sentence * * @param string $noun A noun * @param boolean $article Whether an article should be prepended */ public function noun($noun) { // Remove end if we passed a controller if (str_contains($noun, 'Controller')) { $noun = str_replace('_Controller', null, $noun); $noun = Str::singular(Str::lower($noun)); } // Save noun as core concept if none was defined if (!$this->core) { $this->core = $noun; } $noun = Babel::noun(Str::singular($noun)); $this->addWord('noun', $noun); return $this; }