/** * Transforms ID value * * @param int|string $value * @param string $config * * @return int|string */ function id($value, $config = 'main') { if (is_numeric($value)) { return \App\Utils\ID::encode($value, $config); } return \App\Utils\ID::decode($value, $config); }
/** * Returns and encode hash id value * * @return string */ public function getIdAttribute($value) { return ID::encode($value); }