uuid = substr(base64_encode($model->value), 0, 10); }); parent::boot(); } /** * Return a random row from the table. * * @var mixed $exclude uuid's of rows that should be excluded. */ static public function getRandom($exclude = []) { $q = self::inRandomOrder(); if (!is_array($exclude)) { $exclude = [ $exclude ]; } if (count($exclude) > 1) { $q->where("uuid", 'NOT IN', $exclude); } return $q->first(); } }