/** * Get the cache key for save the token * * @param void * @return string */ protected function getCacheKey() { $model = new \ReflectionClass($this->model); $namespace = Str::slug($model->getNamespaceName()); $class = Str::slug($model->getShortName()); $type = Str::slug($this->type); $key = $this->model->getKey(); if (empty($key)) { throw new Exception("[Token] Error: Empty value for " . $model->getShortName() . "'s attribute '" . $this->model->getKeyName() . "'.", 1); } return 'malahierba-token' . '---' . $namespace . '---' . $class . '---' . $type . '---' . $key; }