Welcome Guest, Not a member yet? Register   Sign In
"Hidden" Fields for Models
#5

I agree with the philosophy of "create the data you want to return" instead of relying just on magic. So a custom function to get the API representation would be good.

You might look into the PHP League's Fractal. It helps solve a number of issues around this, especially when you data gets more complex.
Reply


Messages In This Thread
"Hidden" Fields for Models - by christianitis - 06-14-2022, 08:56 AM
RE: "Hidden" Fields for Models - by iRedds - 06-15-2022, 12:45 AM
RE: "Hidden" Fields for Models - by MGatner - 06-16-2022, 04:39 AM
RE: "Hidden" Fields for Models - by b126 - 06-30-2022, 08:05 AM
RE: "Hidden" Fields for Models - by kilishan - 06-30-2022, 10:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB