r/webdev • • 1h ago

Simplifying the MCP workflow

I rather enjoy Laravel - despite some silliness happening with its administration, apparently - and the workflow makes sense to me. But I find that with this kind of architecture - especially when making a basic CRUD app - I'm writing a lot of code that - theoretically - should be pretty simple to generate from some basic rules. For example, for the backend administration:

- Migration specifies database column name, data type, and any relevant constraints

- Model specifies the same migration column names as Fillables

- Controller validates the exact same information from the migration

- Views display textboxes and number inputs with the same information from the migration

...this seems like an obvious place to have some kind of master schema and just have it generate everything in one pass, doesn't it? I cannot believe I'm the first person to think of this, but I'm unsure of how to phrase the question to try to find out if somebody else has simplified this process. Or if Laravel - or another architecture, perhaps? - allows this kind of streamlined simplicity?

I could easily see that perhaps this super streamlined approach would not handle edge cases at all, but if it really WAS that straightforward...what am I missing? Why can't I find an easy way to do this? Or is there, and I've just never heard of it.

Thank you!

0 Upvotes

9 comments sorted by

View all comments

Show parent comment

2

u/barrel_of_noodles 1h ago

Laravel stubs are boilerplate template files used by Artisan make:* commands to generate new classes and files with placeholders.

If Everytime I made a model I want a controller and specific routes that are predictable ... You just write stubs.

Then, just run: make:mymodel (with whatever your options). And generate the stubs to classes.

Larqvels lifecycle, middleware, and events are all public, hook into whatever you want.

2

u/KaedenCraft 1h ago

Thank you, and Laravel filament does look like a fully featured way of doing what I had envisioned. Thank you so much!