Download the PHP package simplecms/dynamic_unit without Composer
On this page you can find all versions of the php package simplecms/dynamic_unit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download simplecms/dynamic_unit
More information about simplecms/dynamic_unit
Files in simplecms/dynamic_unit
Package dynamic_unit
Short Description 动态单元组件,可以丰富你的Model,让其具备更多的单元属性,无需对数据表进行多次修改调整, 仅需要简单调用即可让单一Model增加更多可控属性
License MIT
Informations about the package dynamic_unit
SimpleCMS/Laravel Dynamic Unit Component
📦 A flexible dynamic attribute package for SKU, dictionary-like metadata, and polymorphic model properties.
English | 简体中文
Features
- Dynamic unit definition and management
- Dynamic attribute items with optional file/media attachment
- Polymorphic model relations for custom attribute storage
- Query by attribute code
- Compatible with Laravel 11 and 12
- Facade and SimpleCMS service integration
Requirements
- PHP ^8.2
- MySQL 8.0+
- Laravel ^11.0 or ^12.0
- Optional: simplecms/framework ^1.0
Installation
If package discovery is not enabled, register the provider manually:
Quick Start
1. Enable dynamic attributes on your model
This adds the customsAttributes morphMany relationship.
2. Filter by attribute codes
3. Create a dynamic unit
4. Query a dynamic unit
5. Update and delete
Facade API
SimpleCMS Extension
If you use simplecms/framework, you can call the service extension directly:
Fixes included in this version
This package version includes fixes for common runtime issues such as:
- incorrect
belongsTomapping inDynamicAttributeandCustomAttribute - null-safe handling when a
codetarget is missing - incorrect
unitupdates that failed to syncitems - Laravel 11/12 dependency compatibility
Migration notes
The package creates the following tables:
dynamic_unitsdynamic_attributescustoms_attributes
Migration files are located in:
If you need a clean reset:
Common issues
1. Empty query results
Check that:
- the model uses
DynamicAttributeTrait dynamic_attribute_idmatchesdynamic_attributes.id- the
codevalues were saved successfully
2. Updated unit does not reflect child attributes
Ensure the items array contains:
- new entries without
id - existing entries with
id - removed items should not be present in the final array
3. Package discovery not working
Try:
License
MIT