scramble icon indicating copy to clipboard operation
scramble copied to clipboard

Guess models of JSON resources from a parameter passed to the resource's `$resource` property

Open romalytvynenko opened this issue 2 years ago • 0 comments

Maybe easier to implement after https://github.com/dedoc/scramble/issues/132

Right now, to get proper types in JsonResource, Scramble will either check App\Models\* ns, or will require user to manually specify a type of a model this resource represents.

This is fine, but feels like it would be a nice DX improvement if Scramble automatically guessed a model for resource based on a type of parameter passed to the resource. If this guessing is not correct, users can always opt-out and specify model manually.

romalytvynenko avatar Apr 24 '23 16:04 romalytvynenko