Let’s be honest: the most boring thing about Laravel is creating the whole application database schema from scratch. While Laravel eases most of the development thanks for its artisan commands, you mostly go back and forth to synchronize the database schematics between the models, factories and seeders, praying everything connects.
It’s not easy task nor a short one:
- Create the Post model,
- connect the model with relationships,
- edit the
- create the the factory and states,
- add database seeder,
- and probably add the PHP Docs to the properties of the Post model.
- Do the same all models you have in mind…
- … and you’ll probably miss something.
Not happy with Laravel Shift Blueprint, Scaffold Interface, Laravel Generator, among others that only offer CRUD, I decided to create something with a good documentation, is easy to pick up, stops if you’re doing something wrong, and does enough to let you start you own thing:
The Laravel Wizard we deserved but never got
Larawiz is short for “Laravel Wizard”, and aims to become one of those installation wizards where you check and uncheck what you want.
The way Larawiz works is by a simple YAML file, where from it will spawn almost everything you need, including effortless relationships.
posts: hasMany Post:
comments: hasMany Comment:
From that, Larawiz guesses most of the things, like the needed tables relations need to work an what not, automatic
id, timestamps, and UUID as primary key, fillable properties, datetime casting, PHP Docs, migrations, factories, seeders, and what not.
You can even do some complicated things, like a polymorphic many-to-many relations, without ever having to think about the pivot model, since Larawiz will automatically guess that.
tags: morphToMany:Tag,taggable Video:
tags: morphToMany:Tag,taggable Tag:
There are a lot of examples and an extensive documentation if you are lost on how to proceed with scaffolding, you fear not, you don’t even need to read the documentation since the YAML file it includes is very self-explanatory.
The package is 99% stable, but you can test it in a fresh Laravel installation and see if it works for you. Give it a chance and tell me what you think.