Mmmm.
i can get like this
return $this->with('warehouse.email', 'warehouse.phone')->paginate(env('PAGINATION_LIMIT', 100));
I have the following table structure.
altogether 4 models (sellers, warehouse, emails, phones)
Ex:
https://api.local/v1/sellers => this returns all the sellers (without warehouse)https://api.local/v1/sellers?include[seller]=warehouse (this returns all sellers with warehouses, because i am setting $this->with=['warehouse'])In here, how can i eager load email, phone models dynamically ?
(i only need to load them when there is a request like this)
https://api.local/v1/sellers?include[seller]=warehouse&&include[warehouse]=email,phone
can someone help me.
Thanks
Please or to participate in this conversation.