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

Allow classnames for Transformer and Serializers #28

Merged
merged 3 commits into from
Aug 18, 2017

Conversation

cviebrock
Copy link
Contributor

@cviebrock cviebrock commented Aug 18, 2017

This allows passing a classname (i.e. string) anywhere you can specify a Transformer or Serializer.

e.g., this will now work:

Fractal::create($books, BookTransformer::class, ArraySerializer::class)->toArray();

(If this is accepted, I'll make a PR to spatie/laravel-fractal to support the changes there as well.)

@sebastiandedeyne
Copy link
Member

Wanted this for a while, thumbs up from me!

@freekmurze freekmurze merged commit 88db670 into spatie:master Aug 18, 2017
@freekmurze
Copy link
Member

Another quality PR, thanks Colin! 👍

@cviebrock cviebrock deleted the allow-classnames branch August 21, 2017 14:54
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

Successfully merging this pull request may close these issues.

None yet

3 participants