Repository navigation
Releases
2.8.0 — showDeleted from useBaseListing
Regenerated soft-delete listings need @dejwcake/craftable 2.5.0. Update it before regenerating (see UPGRADE.md → 2.8.0).
Changed
- Generated listings take
showDeletedfromuseAppListing(props)(useBaseListingin the frontend) instead of a local ref andonShowDeletedChange();<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
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'sdelete()/forceDelete()/restore()result, and afalsereturn ended the loop. They now return nothing. - User template:
destroy()runs in a transaction, andbulkDestroy()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
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_uniqueignored). Before, any column in a composite index got auniquerule. - 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_uniquecolumn are treated as soft-delete aware, not only ones named*deleted_at*.
2.7.0 — Trash for soft-deleting models
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/craftableto 2.4.0 anddejwcake/admin-uito 2.5.0 before regenerating (not enforced bycomposer.json). - A resource already migrated needs a new migration adding
admin.{model}.restore,bulk-restore,force-deleteandbulk-force-deletepermissions. - A model generated with
--without-modelor written by hand needsisRestorable()(return true;is enough without parent rows). - Overridden
controller,routes,blade-indexandvue-listingtemplates don't get the trash; compare them with the package's.
Added
admin:generate:trash-controllerandadmin:generate:request:{force-destroy,bulk-force-destroy,restore,bulk-restore};admin:generateruns them.- Model
isRestorable()from itsbelongsTorelations; 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
destroyruns in a transaction andbulkDestroydeletes 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
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
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
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
uuidcolumn useHasUuidsand declareuniqueIds()returning['uuid']; the primary key stays as it is uuidis 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
mariadbdriver; the docker-compose service is renamedmysql→mariadb— useDB_CONNECTION=mariadb
2.5.1 — Render wysiwyg on the show page
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 viav-htmlinstead of as escaped text- User factory: the
unverified(), two-factor and password states pass an array tostate()instead of a closure Listing.vue: removed the long comment aboveuseResponsiveColumns()
2.5.0 — Action selection and show pages
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/craftable2.2.0 (ShowButton,BackButton) anddejwcake/admin-ui2.3.2 (admin.index.try_changing_filters*). Update both before regenerating.
Added
--only/--exceptchoose the generated actions (create, show, edit, delete, bulk-delete, export;indexis always generated) onadmin:generate,admin:generate:user,admin:generate:admin-userand the selection-dependent generators.admin:generate:blade-showandadmin: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
FromQuerywithWithCustomChunkSizeinstead of loading every row. - The permissions migration is always complete;
--without-bulkonadmin:generate:permissionsis ignored.
Deprecated
-e/-wb(use--only/--except),ColumnCollection::getVisible()(usegetForForm()), 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,
.gitattributeskeeps dev files out of dist archives.
2.4.0 — Stricter relation detection, camelCase factory states
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_publishednow givesisPublished()/
isNotPublished()instead ofis_published()/notIs_published(). Single-word columns keep
their names (enabled()/notEnabled()). The states usestatic fn (): arrayclosures and no
longer needphpcs:ignorecomments. - Pivot detection is stricter: a table counts as a
belongsToManypivot only when it holds just its
two foreign keys (plus optionalidand timestamps). Entity tables that reference two other tables
are no longer turned intobelongsToManyrelations. - 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
hasManymethods.
Internal
AGENTS.md/CLAUDE.mdfor coding agents.- Request and permission generators resolve their template through a
$viewproperty. - New tests for relation detection, factory and model generation; snapshots regenerated.