nilportugues / laravel5-jsonapi

Laravel 5 JSON API Transformer Package

Home Page:http://nilportugues.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't we get different type name (when we write in getalias function in transformer)if we use same model in two different transformer??

saminanirmala opened this issue · comments

It's all about normalizing, so as by default, no, it's not possible and it's intended to be that way. But that does not mean it's not possible to be done.

For instance, let's say you have a class: MyClass. If you want this to be mapped as type my_class you will just write a mapping file.

But if you want to have same class, different mappings, extend MyClass and map the extended class and give it a new name

Could you provide me a use-case you want to do this? I will consider this as an enhancement if so.