/**
  * Handle request decodable params
  *
  * @param \Illuminate\Http\Request  $currentRequest
  * @param $configKey
  */
 protected function forRequest($currentRequest, $configKey)
 {
     $requestParams = $currentRequest->all();
     $mergeable = [];
     foreach ($requestParams as $parameterKey => $parameterValue) {
         if (Str::startsWith($parameterKey, $configKey)) {
             $key = 'decoded_' . $parameterKey;
             $mergeable[$key] = BijectiveShortener::decodeToInteger($parameterValue);
         }
     }
     if (!empty($mergeable)) {
         $currentRequest->merge($mergeable);
     }
 }
Пример #2
0
 /**
  * Get the shortened id of the current class such as an eloquent model
  *
  * @return string
  */
 public function shortenedId()
 {
     return BijectiveShortener::makeFromInteger($this->id);
 }