You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for the package, it has been really helpful :)
Now for the issue.
If i have defined a list of available relations on the transformer and then when i do a request and i request to include a relation that's not on that list and at the same time is invalid (doesn't exist on the model), it throws an exception about the relation being invalid, IMO, that shouldn't throw the exception, at all, since that's not on the list of the available relations.
Transformer:
<?phpnamespaceApp\Transformers;
useApp\Models\Client;
classClientTransformerextendsTransformer
{
/** * List of available relations. * * @var array */protected$relations = ['invoices'];
// Truncated for brevity
}
If i hit http://foo.dev/clients?with=invalid_relation an exception is thrown.
And if for example, i make that array empty and require ?with=invoices it doesn't throw an error, which is kinda expected, since it's not allowed.
I know i can catch the exception and deal with it, however, i don't feel that this is the correct behaviour.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi
First, thanks for the package, it has been really helpful :)
Now for the issue.
If i have defined a list of available relations on the transformer and then when i do a request and i request to include a relation that's not on that list and at the same time is invalid (doesn't exist on the model), it throws an exception about the relation being invalid, IMO, that shouldn't throw the exception, at all, since that's not on the list of the available relations.
Transformer:
If i hit
http://foo.dev/clients?with=invalid_relation
an exception is thrown.And if for example, i make that array empty and require
?with=invoices
it doesn't throw an error, which is kinda expected, since it's not allowed.I know i can catch the exception and deal with it, however, i don't feel that this is the correct behaviour.
Thanks!
The text was updated successfully, but these errors were encountered: