/** * Generate, and return the attribute. * * @throws \League\FactoryMuffin\Exceptions\MethodNotFoundException * * @return mixed */ public function generate() { $method = substr($this->kind, 5); $args = array(); if (strstr($method, '|')) { $parts = explode('|', $method); $method = array_shift($parts); if ($parts[0] === 'factory' && count($parts) > 1) { $args[] = $this->factory($parts[1]); } else { $args[] = FactoryMuffin::generateAttr(implode('|', $parts), $this->object); } } return $this->execute($method, $args); }