/** * Set the claim value, and call a validate method if available * * @param User $value * @throws InvalidClaimException * @return $this */ public function setValue($value) { // Transform the user before encoding $transformerService = App::make(TransformerService::class); $transformer = new EloquentModelTransformer($transformerService); $value = $transformer->transform($value); return parent::setValue($value); }
/** * Transform the object into a response entity * @param $object * @return array */ public function transform($object) { $thisTransformation = $this->transformItem($object['token']); return parent::transform($thisTransformation); }