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

6 comments sorted by

1

u/barrel_of_noodles 56m ago

You're looking for Laravel filament.

Also write whatever generator commands you want, stubs exists

0

u/KaedenCraft 53m ago

I'm unfamiliar with what "stubs" means in this context.

1

u/barrel_of_noodles 50m 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.

1

u/KaedenCraft 47m ago

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

1

u/creaturefeature16 57m ago

I'm new to Laravel, and enjoying it, but already seeing the same boilerplate issue. I don't have an answer, but I'm leaving a comment to follow this thread, in case someone else chimes in. 

•

u/RiceEvening4211 0m ago

You're not missing anything — that repetition is real, and a single master schema sounds great until the edge cases show up: different validation per form, computed fields, authorization, and relationships that don't map one-to-one. That's why the practical answer is a split: use Filament for the admin CRUD, where it can generate forms and tables from the model, and custom Artisan stubs for your app-facing CRUD. Let the generator handle the boring 80%, then hand-edit the exceptions instead of forcing them into config.