예제 #1
0
 /**
  * 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);
 }
예제 #2
0
 /**
  * Transform the object into a response entity
  * @param $object
  * @return array
  */
 public function transform($object)
 {
     $thisTransformation = $this->transformItem($object['token']);
     return parent::transform($thisTransformation);
 }