flugg / laravel-responder

A Laravel Fractal package for building API responses, giving you the power of Fractal with Laravel's elegancy.
MIT License
862 stars 86 forks source link

Eager Loading maximum 5 relationships #122

Closed brunorsantos closed 6 years ago

brunorsantos commented 6 years ago

Hi, Thanks for developing this great package!

I need to include some relationships via query strings while making a request. I'm using 'with' in my URL. I realized that Laravel responder is loading in JSON 5 relations deep at maximum.

I'm trying to Get something like: GET /products?with=orders.customer.user.type.category.group

Inside the response is loaded an object that does not contain a 'group' attribute. Is this an expected behavior? Is there some alternative for loading something like this?

I'm using version 2.0.

Thanks

flugg commented 6 years ago

Hi @brunorsantos! Check the config/responder.php file, there should be a recursion limit option. This defaults to 5, but feel free to change it to whatever you like :)

brunorsantos commented 6 years ago

Thanks!

I didn't notice it! Sorry about this!