knuckleswtf / scribe

Generate API documentation for humans from your Laravel codebase.✍
https://scribe.knuckles.wtf/laravel/
MIT License
1.7k stars 303 forks source link

How to deal with custom fields in laravel Resources? #709

Open throcha-aiq opened 1 year ago

throcha-aiq commented 1 year ago

Scribe version

4

Your question

I have a resource who returns custom fields that don't exist in the model, so Scribe is giving me this error:

image

Already tried using @mixin in the resource's docblock but it didn't work.

Controller is like this: image

Can Anybody help me?

Docs

shalvah commented 1 year ago

Hmm. Where does the extra 'id' come from? How does your code create the resource?