Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Modelschema Laravel Package

grazulex/laravel-modelschema

Laravel ModelSchema is a lightweight package that inspects your Eloquent models and converts them into database schema definitions, so you can generate migrations, keep models and tables in sync, and document your data layer from a single source of truth.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Start with GenerationService::generateModel() for a single model/component and GenerationService::generateAll() for batch generation.
  • Look first at the generator return values: the package now treats returned json/yaml fragments as the source of truth for success in v1.3.1+.
  • First day-to-day use case: wire generateAll() into an Artisan command or queued job, then use logs/metrics to confirm generated components instead of trusting a success key.
  • If upgrading, verify you are on v1.3.1 or later before relying on failure counts in logs/metrics.

Implementation Patterns

  • Wrap generation in a Laravel command or job, call GenerationService::generateModel() or generateAll(), and inspect the returned fragments directly when you need per-component results.
  • Use generateAll() for bulk scaffolding and CI-style checks; use generateModel() when you need focused regeneration and clearer local debugging.
  • For metrics, run generation through the service rather than calling generators directly so the fixed success detection in v1.3.1 is applied consistently.
  • In tests, assert on returned json/yaml fragment presence rather than a success flag; this matches the service’s v1.3.1 behavior.
  • For custom generators, keep returning json/yaml fragments in the expected shape so service-level logging and metrics classify results correctly.

Gotchas and Tips

  • Pre-v1.3.1, generateAll() and generateModel() could report successful components as failed because they looked for a success key the generators never set. Do not carry that assumption into custom code or dashboards.
  • Do not treat a missing success key as failure on v1.3.1+; check the returned json/yaml fragments instead.
  • If logs or metrics still look wrong after upgrading, inspect the raw generator output first, then confirm the service is resolving the updated package version.
  • When debugging batch runs, isolate a single generateModel() call and compare its returned fragments with the batch generateAll() summary.
  • No config change is called out in v1.3.1; the main extension point is the generator output contract. Custom generators should return consistent fragments so logging and metrics remain meaningful.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource