romegasoftware/laravel-schema-generator
A Laravel package that generates migration files from an existing database schema. It inspects tables, columns, indexes, and foreign keys, then scaffolds ready-to-edit migrations, making legacy databases and reverse-engineering projects easier to bring into Laravel.
This package bridges Laravel's server-side validation rules and the browser: you declare rules once (typically in a FormRequest), the package emits a generated artifact the front end consumes, and the browser enforces the same constraints before submit. v1.0.14 fixes the relative-date case, so it's the release to start on if you have any before: / after: rules.
Minimal path:
FormRequest — e.g. 'start_date' => ['required', 'date', 'before:+1 week'].First real use case: a booking or scheduling form with a "must be within the next N days" constraint. This is precisely the scenario the release targets.
Single source of truth for rules. Keep rule definitions in FormRequest classes and regenerate the artifact as part of your build/deploy pipeline. Because v1.0.14 makes generated files stable, regenerating no longer produces spurious diffs just because time passed — you can commit generated output and review it meaningfully.
Relative rules belong in the browser, static rules don't. Use before:+1 week, after:-30 minutes, before:now+2 days, etc. for windowed constraints. Keep absolute dates (before:2025-12-31) as literals — they're stable by nature and there's no reason to defer them.
Signed offsets you can rely on: seconds, minutes, hours, days, weeks, with an optional now prefix. Prefer explicit units (+2 hours over +120 minutes) only when it reads better; both work.
Timezone discipline. Set app.timezone to UTC (or at minimum ensure the validation timezone is UTC). Days and weeks are treated as elapsed durations, so a "week" is not a calendar week across a DST boundary. UTC makes PHP and browser limits agree exactly. If your app must run in a local timezone, expect sub-hour drift around DST transitions and treat the server as authoritative.
Test at both layers. In PHPUnit, assert the generated artifact contains the expected dynamic expression (not a resolved timestamp), and separately assert the server accepts/rejects the right values. Avoid asserting on exact epoch values for relative rules — they legitimately move.
Pair with server-side validation always. The browser check is UX; the FormRequest rule is the guarantee. Never let the generated file be the only enforcement.
+1 week means seven elapsed days. If you need "same weekday next week," that's not what this expresses.FormRequest.How can I help you explore Laravel packages today?