latevaweb/laravel-custom-properties
hasOneThrough, withCount) without reinventing dynamic property logic.custom_properties JSON column to existing tables) without downtime, critical for legacy system modernization or monolithic-to-modular refactoring.casts (for stricter typing).json casting or a monolithic custom solution.users, orders with no dynamic fields)."This Laravel package lets us add dynamic fields to database models without schema changes—think of it like ‘sticky notes’ for your data. For example:
"This package solves a common pain point: adding dynamic attributes to Eloquent models without bloating our schema or writing boilerplate. Here’s why it’s a no-brainer for us:
json column and the trait—no downtime, no complex ALTER TABLE scripts."This package lets you add dynamic fields to Eloquent models in 5 minutes—no migrations, no headaches. Here’s how it works:
use LaTevaWeb\CustomProperties\HasCustomProperties;
json column to your table:
$table->json('custom_properties')->nullable();
$user->setCustomProperty('premium_feature', true)->save();
$user->getCustomProperty('premium_feature'); // true
Why it’s awesome:
set, get, has, forget—just like a native attribute.
Caveats:WHERE custom_properties->>'key' = 'value' (use LIKE or full-text search instead).
Let’s try it on [Model Y]—it’s perfect for [use case]!"How can I help you explore Laravel packages today?