Skip to content

2.4.0 — Stricter relation detection, camelCase factory states

Choose a tag to compare

@dejwCake dejwCake released this 02 Oct 15:10
· 30 commits to main since this release

Generated output differs from previous versions; existing generated code is untouched. If you regenerate a factory, update calls to boolean states on snake_case columns (see below).

Changed

  • Generated factory boolean states are camelCase: is_published now gives isPublished() /
    isNotPublished() instead of is_published() / notIs_published(). Single-word columns keep
    their names (enabled() / notEnabled()). The states use static fn (): array closures and no
    longer need phpcs:ignore comments.
  • Pivot detection is stricter: a table counts as a belongsToMany pivot only when it holds just its
    two foreign keys (plus optional id and timestamps). Entity tables that reference two other tables
    are no longer turned into belongsToMany relations.
  • Pivot table name and key columns are read from the detected schema instead of being derived from
    naming conventions.
  • Generated models emit #[Table] after #[Fillable] (and after #[Appends] on admin users).

Fixed

  • #[Table(name: '...')] was HTML-escaped, producing invalid PHP for models whose table name does
    not follow the convention.
  • Two blank lines between consecutive generated hasMany methods.

Internal

  • AGENTS.md / CLAUDE.md for coding agents.
  • Request and permission generators resolve their template through a $view property.
  • New tests for relation detection, factory and model generation; snapshots regenerated.