Flag --views in make:controller --resource and make:model -a #39576
Replies: 3 comments 3 replies
-
I think for CRUD related stuff, this would be absolutely fantastic, more so if we could then have integration within Laravel Breeze/Jetstream. I definitely think what you've mentioned about having dev prepared stubs would be superb, even just a simple listing of the models, and a form to add, to give a base to work from. |
Beta Was this translation helpful? Give feedback.
-
Would love to see this in the upcoming versions of laravel! |
Beta Was this translation helpful? Give feedback.
-
Update on this one: I decided to not pursue it after all, as it turns out to be a huge amount of work:
And this is not even starting on the content of the views, any type of stubs or For generating views, I recommend this old package - https://github.com/svenluijten/artisan-view - or just google "laravel make view" and you will find more alternatives. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
After my first PR being merged, I decided to think what else could make our lives easier related to make:model and make:controller
And, for a typical CRUD scenario, we probably need Views.
I've raised a Twitter discussion, and so far the idea seems to resonate with people.
What developers tend to do is create those views manually, and then write code in controllers to use those views, manually again.
So we could automate the part of creating the files.
Of course, views are very individual, based on custom design, so by default Blade files would be empty.
So:
would:
resources/views/posts
index.blade.php
,create.blade.php
andedit.blade.php
return view('posts.index')
and respectively increate()
andedit()
methods.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions