-
Notifications
You must be signed in to change notification settings - Fork 277
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
Nested Resources #430
Comments
Would this syntax be less clutter? We could still derive the Job/Comment:
resource: store, destroy
validation: comment/comment |
I'm not following this very closely. However, I agree we could infer some things by default. But we should allow the proposed syntax in the event they are not following conventions. Also, the |
@jasonmccreary I experimented with this in https://github.com/faustbrian/blueprint/commit/047c0a8fa6281c9da1888830ead9e823373e757e. The main challenge is statement generation, as most classes rely on the controller name. For nested controllers, we need to adjust the return values of For instance, variables should be named However, statement generation would still have some challenges, such as modifying independent classes like EloquentStatement to generate statements like |
Synopsis:
The ability to generate nested resources for other models/controllers. For example:
A job can have many comments, but a course could also have many comments, and they would use a Comment model, with a commentable morph (which we can do already), now to comment on a job with Laravel you can do:
web.php
JobCommentController.php
Currently we don't have a way to do this. Would this be something you're open to?
Proposed Syntax:
So, the
model
is the resource model It is nested for, andnested
is the model it uses to store/delete data, thevalidation
is the file It generates for validation. Because the comment is used for multiple resources, it doesn't make sense to add that under theRequests/Job/
folder but the nested model's own folder, so you could useCommentStoreValidation
for both Jobs and courses or whatever other model can be commented on.The text was updated successfully, but these errors were encountered: