Skip to content

Set the data key when using Fractal #33

@Anahkiasen

Description

@Anahkiasen

When doing simply this:

Route::get('users/{user}', function($user) {
    return User::find($user);
});

I get this:

{
    "user": {

    }
}

However if I use a Transformer, it changes and I can't seem to find the option to change it back:

API::transform('Users' 'UserTransformer');
{
    "data": {

    }
}

Any way to achieve this?

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