Question:Is it possible to show new added Laravel resources API fields on specific routes?
Example: I have a
UserResourcewhich has 3 fields –
id, name and email. I’m returning
UserResourcein 10 routes. For 11th route added new field –
Is it possible to show new
postsfield only for 11th route?
Answer:Of course you can, so you need to add two things. First inside of your controller in the method where you want to load posts do the following
UserResourseclass add the following
If you have better answer, please add a comment about this, thank you!