public function findOrCreate($tagName) { $tag = $this->find($tagName); if (!$tag) { $tag = Tag::create(['name' => $tagName]); } return $tag; }