Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
romalytvynenko opened this issue Apr 24, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@romalytvynenko
Copy link
Member

romalytvynenko commented Apr 24, 2023

Maybe easier to implement after #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 romalytvynenko added the enhancement New feature or request label Apr 24, 2023
@romalytvynenko romalytvynenko changed the title Guess models for JSON resources Guess models for JSON resources from a parameter passed to the resource's $resource property Apr 24, 2023
@romalytvynenko romalytvynenko changed the title Guess models for JSON resources from a parameter passed to the resource's $resource property Guess models of JSON resources from a parameter passed to the resource's $resource property Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant