Skip to content

No longer able to call transform. #101

@bweston92

Description

@bweston92

I like to now and user the transformer to transform objects inline ready for sending like the following. Unfortunately a request object is required for the parseFractalIncludes method and is throwing an error.

Example:
GET /authentication/status

{
  authenticated: true
  user: {
    data: {
      # Transformed data here #
    }
  }
}

My code

$authenticated = (bool) ($user = API::user());

if ($authenticated)
{
  $user = app('dingo.api.transformer')->transform($user);
}

return compact('authenticated', 'user');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions