Skip to content

Releases

2.8.0 — showDeleted from useBaseListing

Choose a tag to compare

@dejwCake dejwCake released this 06 Nov 21:42

Regenerated soft-delete listings need @dejwcake/craftable 2.5.0. Update it before regenerating (see UPGRADE.md → 2.8.0).

Changed

  • Generated listings take showDeleted from useAppListing(props) (useBaseListing in the frontend) instead of a local ref and onShowDeletedChange(); <ShowDeleted v-model="showDeleted" .../> has no @update:modelValue. Behaviour is unchanged. Already generated code keeps working.

Internal

  • VueListing snapshots updated, UPGRADE.md entry.

2.7.2 — Fix bulk delete, force delete and restore in generated controllers

Choose a tag to compare

@dejwCake dejwCake released this 04 Nov 20:58

Changes generated output only: regenerate controllers to pick up the fixes. Existing code is not touched.

Fixed

  • Bulk delete, force delete and restore no longer stop half-way: the ->each() callbacks returned the model's delete() / forceDelete() / restore() result, and a false return ended the loop. They now return nothing.
  • User template: destroy() runs in a transaction, and bulkDestroy() deletes the models one by one instead of with a query-level delete, so model events and soft deletes apply.

2.7.1 — Scoped unique rules for composite indexes

Choose a tag to compare

@dejwCake dejwCake released this 04 Nov 17:52

Changes generated output only: regenerate a CRUD to pick up the new unique rules. Existing code is not touched.

Fixed

  • Generated columns (virtual/stored) are skipped when building a CRUD.
  • A unique index counts for a column only when that column is its last key column (deleted_at / deleted_unique ignored). Before, any column in a composite index got a unique rule.
  • Composite unique indexes generate a scoped rule: ->where('<col>', $this->input('<col>'…)) for each other key column, defaulting to the model's value on update.
  • Indexes containing a deleted_unique column are treated as soft-delete aware, not only ones named *deleted_at*.

2.7.0 — Trash for soft-deleting models

Choose a tag to compare

@dejwCake dejwCake released this 31 Oct 09:51

Trash for soft-deleting models: delete permanently, restore and "Show deleted". Generator output changes only for tables with a deleted_at column; nothing already generated changes.

Upgrade action

  • Update @dejwcake/craftable to 2.4.0 and dejwcake/admin-ui to 2.5.0 before regenerating (not enforced by composer.json).
  • A resource already migrated needs a new migration adding admin.{model}.restore, bulk-restore, force-delete and bulk-force-delete permissions.
  • A model generated with --without-model or written by hand needs isRestorable() (return true; is enough without parent rows).
  • Overridden controller, routes, blade-index and vue-listing templates don't get the trash; compare them with the package's.

Added

  • admin:generate:trash-controller and admin:generate:request:{force-destroy,bulk-force-destroy,restore,bulk-restore}; admin:generate runs them.
  • Model isRestorable() from its belongsTo relations; restore refuses non-restorable rows, bulk restore skips them.
  • Trash routes, permissions, "Show deleted" toggle, restore and force-delete in the Blade index and Vue listing.
  • admin:generate:request:index --template.

Changed

  • For soft-deleting models destroy runs in a transaction and bulkDestroy deletes row by row, so model events and observers fire for bulk deletes too. Integrity constraint violations come back as validation errors.
  • Long route(...) lines in the generated controller wrap at 120 characters.

Internal

  • Snapshots for a table without soft deletes guard the unchanged output; README and UPGRADE sections.

2.6.2 — Keep the uuid column visible in narrow listings

Choose a tag to compare

@dejwCake dejwCake released this 27 Oct 10:31

The generated listing ranks the uuid column right after the last other column (capped at 10) instead of always giving it priority 10, so a table with few columns shows it on ordinary screens while it is still the first column hidden on a wide table. Generator output change only — already generated listings are untouched.

2.6.1 — Exclude uuid column from fillable

Choose a tag to compare

@dejwCake dejwCake released this 27 Oct 09:49

Generated models no longer list the uuid column in #[Fillable] — it is filled by HasUuids. Generator output change only; in models generated by 2.6.0, drop 'uuid' from #[Fillable] by hand if you want the same.

2.6.0 — Support uuid column

Choose a tag to compare

@dejwCake dejwCake released this 27 Oct 09:26

Tables with a uuid column now generate a model that fills it automatically. Generator output change only — already generated code is untouched.

Added

  • Generated models of tables with a uuid column use HasUuids and declare uniqueIds() returning ['uuid']; the primary key stays as it is
  • uuid is left out of the form, store/update validation and the factory; the listing shows it at the lowest column priority

Internal

  • MySQL-compatible tests run on the mariadb driver; the docker-compose service is renamed mysql → mariadb — use DB_CONNECTION=mariadb

2.5.1 — Render wysiwyg on the show page

Choose a tag to compare

@dejwCake dejwCake released this 20 Oct 10:46

Changes generator output only. Code you already generated stays as it is; regenerate to pick it up.

Changed

  • Show.vue: wysiwyg columns (perex, text, body, description) now render as HTML via v-html instead of as escaped text
  • User factory: the unverified(), two-factor and password states pass an array to state() instead of a closure
  • Listing.vue: removed the long comment above useResponsiveColumns()

2.5.0 — Action selection and show pages

Choose a tag to compare

@dejwCake dejwCake released this 20 Oct 06:04

Show pages are now generated by default; pass --except=show to keep the previous output. See UPGRADE.md → "2.5.0".

Upgrade action

  • Regenerated code uses @dejwcake/craftable 2.2.0 (ShowButton, BackButton) and dejwcake/admin-ui 2.3.2 (admin.index.try_changing_filters*). Update both before regenerating.

Added

  • --only / --except choose the generated actions (create, show, edit, delete, bulk-delete, export; index is always generated) on admin:generate, admin:generate:user, admin:generate:admin-user and the selection-dependent generators.
  • admin:generate:blade-show and admin:generate:vue-show: a show page with belongs-to and belongs-to-many relations shown by their label.

Changed (generated output)

  • Controllers, routes, listings, requests and translations contain only the selected actions.
  • Listings read belongs-to relations by their snake_case key, fixing empty cells for multi-word relations.
  • Exports use FromQuery with WithCustomChunkSize instead of loading every row.
  • The permissions migration is always complete; --without-bulk on admin:generate:permissions is ignored.

Deprecated

  • -e / -wb (use --only / --except), ColumnCollection::getVisible() (use getForForm()), and the template variables $visibleColumns / $hasBulk (use $formColumns / $hasBulkDelete).

Internal

  • Snapshot cases for action combinations; README section on choosing actions.
  • phpmd 3, coverage in CI, MariaDB 12.3, .gitattributes keeps dev files out of dist archives.

2.4.0 — Stricter relation detection, camelCase factory states

Choose a tag to compare

@dejwCake dejwCake released this 02 Oct 15:10

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.