Exemple #1
0
 /**
  * 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);
 }
Exemple #2
0
 /**
  * Returns and encode hash id value
  *
  * @return string
  */
 public function getIdAttribute($value)
 {
     return ID::encode($value);
 }