Skip to content

Instantly share code, notes, and snippets.

@ambengers
Last active November 16, 2022 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ambengers/62fea888b18d8e5754ac3f0aeb9e94f5 to your computer and use it in GitHub Desktop.
Save ambengers/62fea888b18d8e5754ac3f0aeb9e94f5 to your computer and use it in GitHub Desktop.
Laravel Haiku Class
<?php
namespace App;
class Haiku
{
/**
* An array of adjectives.
*
* @var array
*/
protected static $adj = [
'aged',
'amiable',
'ancient',
'balmy',
'beautiful',
'billowing',
'blessed',
'bold',
'bountiful',
'breezy',
'bubbling',
'calm',
'celestial',
'clean',
'cold',
'colorful',
'colossal',
'crimson',
'curved',
'damp',
'deep',
'divine',
'exquisite',
'fancy',
'fathomless',
'floral',
'fragrant',
'frosty',
'gentle',
'gorgeous',
'graceful',
'harmonious',
'hidden',
'hollow',
'holy',
'icy',
'indigo',
'jubilant',
'limitless',
'lingering',
'lively',
'mellow',
'merciful',
'mirthful',
'misty',
'moonlit',
'mythic',
'quaint',
'polished',
'precious',
'purple',
'red',
'resilient',
'royal',
'scenic',
'silent',
'snowy',
'solitary',
'sparkling',
'stunning',
'summer',
'smooth',
'tall',
'twilight',
'unwavering',
'warm',
'wandering',
'weathered',
'whispering',
'wispy',
'zealous',
];
/**
* An array of nouns.
*
* @var array
*/
protected static $nouns = [
'abyss',
'atoll',
'aurora',
'autumn',
'badlands',
'beach',
'breeze',
'briars',
'butterfly',
'brook',
'canopy',
'canyon',
'cavern',
'chasm',
'cliff',
'cloud',
'cove',
'crater',
'creek',
'darkness',
'dawn',
'desert',
'dew',
'dream',
'dusk',
'dust',
'farm',
'feather',
'fern',
'field',
'fire',
'firefly',
'flowers',
'fog',
'forest',
'frost',
'galaxy',
'garden',
'geyser',
'glade',
'grass',
'grove',
'hamlet',
'haze',
'hill',
'hurricane',
'iceberg',
'king',
'lagoon',
'lake',
'leaf',
'meadow',
'mist',
'moon',
'morning',
'moss',
'mountain',
'night',
'oasis',
'ocean',
'peak',
'pebble',
'pine',
'plateau',
'pond',
'rain',
'reef',
'reserve',
'resonance',
'river',
'sanctuary',
'sands',
'sea',
'shadow',
'shelter',
'silence',
'snowflake',
'sound',
'spring',
'star',
'storm',
'stream',
'summer',
'summit',
'sun',
'sunrise',
'sunset',
'surf',
'thunder',
'temple',
'truth',
'tundra',
'valley',
'waterfall',
'wave',
'wildflower',
'willow',
'winds',
'winter',
];
/**
* Get a random, pretty name.
*
* @return string
*/
public static function name()
{
return static::$adj[array_rand(static::$adj)].'-'.
static::$nouns[array_rand(static::$nouns)];
}
/**
* Get a random, pretty name with additional random token.
*
* @return string
*/
public static function withToken()
{
return static::name().'-'.strtolower(str_random(8));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment