Feature to streamline generated resource controllers and form request when scaffolding models using the --all flag #47975
Unanswered
emmadesilva
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone! I love the Artisan commands for scaffolding boilerplate files. Something struck me as a bit unintuitive though. When generating a model using the --all flag, the generated form requests return false from the authorize methods. At this point, we know that the user generated a policy, so would it not make more sense to fill in this method so that it defers to said policy?
Furthermore, I think it would be really nice if the generated resource controller's constructor method comes prefilled with
$this->authorizeResource
. I think this feature is quite related to the form request change, but could easily be a part of a separate PR.I am more than willing to work on implementing this issue, but I wanted to check here first to get the team's thoughts on the matter in case this is not something you are interested in having implemented, as I can imagine the added code complexity could weight harder than the benefit provided.
Beta Was this translation helpful? Give feedback.
All reactions