Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set includes for response #38

Open
naabster opened this issue Jun 8, 2017 · 1 comment
Open

set includes for response #38

naabster opened this issue Jun 8, 2017 · 1 comment

Comments

@naabster
Copy link

naabster commented Jun 8, 2017

I wonder if there is a nicer way to set includes for the response. I dont mean to parse the includes from include parameter, but set them "manually" for that response.

right now I am doing this (Laravel):

    $this->response->getManager()->parseIncludes('team');
    return $this->response->withItem($request->user(), new UserTransformer);

Maybe something like

    return $this->response->parseIncludes('team')->withItem($request->user(), new UserTransformer);

would be shorter and nicer. I could prepare a pull request if that's something you would like to integrate.

@maximebeaudoin
Copy link
Member

@naabster Hi, i think something like $this->response->includes('team')->withItem($request->user(), new UserTransformer); could be a good format. If you want, you can create a PR for that.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants