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

What about laravel Resources? #119

Open
WatheqAlshowaiter opened this issue Nov 30, 2021 · 3 comments
Open

What about laravel Resources? #119

WatheqAlshowaiter opened this issue Nov 30, 2021 · 3 comments

Comments

@WatheqAlshowaiter
Copy link

like when we say php artisan make: resource SomeResouce

should we make them singular, or plural, or in which cAsEs?

@WatheqAlshowaiter WatheqAlshowaiter changed the title What about Resource? What about laravel Resources? Nov 30, 2021
@alexeymezenin
Copy link
Owner

I think it should be singular in StudlyCase, i.e. UserResource

@bijaydas
Copy link

How do you manage, if you need to return different keys for a single resource and collection of resources?

@spekulatius
Copy link
Contributor

Usually resources are single-purpose and should only return one set of information @bijaydas. If you got cases in which you tempted to return a large, combined set you should split them up. I hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants