Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Model Settings Laravel Package

glorand/laravel-model-settings

Add per-model settings to Laravel Eloquent with an easy API to get/set/check/remove values. Choose storage via JSON field, separate settings table, or Redis. Supports defaults, validation, and persistence for user or entity preferences.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Dynamic Configuration Management: Enables storing and retrieving application settings (e.g., feature flags, API keys, UI toggles) per model instance (e.g., tenant-specific configurations) without bloating a monolithic settings table.
  • Roadmap Acceleration: Reduces development time for multi-tenant or role-based configuration systems by abstracting away repetitive CRUD logic for settings.
  • Build vs. Buy: Avoids reinventing a scalable settings management system, especially for Laravel-based SaaS platforms or applications requiring granular per-record customization.
  • Use Cases:
    • Tenant/Organization-specific configurations (e.g., branding, feature toggles).
    • User account preferences (e.g., theme, notifications).
    • Dynamic API endpoints or service integrations per entity.
    • A/B testing or experimental feature rollouts tied to specific records.

When to Consider This Package

  • Adopt When:
    • Your Laravel app requires per-model settings (e.g., settings tied to User, Company, or Product models).
    • You need type-safe, validated settings with minimal boilerplate (e.g., Settings::for($user)->get('theme')).
    • Your team prioritizes developer experience over raw performance (e.g., avoiding raw SQL for simple key-value lookups).
    • You’re using Laravel 9+ with PHP 8.1+ and want PSR-compliant, well-tested code.
  • Look Elsewhere If:
    • You need global app-wide settings (consider Laravel’s built-in config() or env()).
    • Your use case requires complex nested settings (e.g., JSON hierarchies) that this package doesn’t natively support (may need customization).
    • You’re constrained by extreme performance requirements (this package adds a thin abstraction layer).
    • Your team prefers NoSQL (e.g., Redis) for settings storage (this defaults to a relational database).

How to Pitch It (Stakeholders)

For Executives: "This package lets us ship tenant-specific configurations (e.g., per-company branding or feature flags) 10x faster by eliminating manual database table setup and CRUD logic. For example, instead of writing 50 lines of code to manage settings for a new Organization model, we’d use a single trait. It’s battle-tested (900+ stars), MIT-licensed, and aligns with our Laravel stack—reducing technical debt while enabling rapid iteration for our multi-tenant roadmap."

For Engineering: *"Laravel Model Settings gives us a clean, type-safe API to attach settings to any Eloquent model. Key benefits:

  • Zero boilerplate: Add \Glorand\Settings\Traits\HasSettings to any model to enable settings.
  • Validation: Define settings as PHP classes with casting/validation (e.g., public string $theme = 'dark').
  • Performance: Uses Laravel’s query builder under the hood; minimal overhead.
  • Flexibility: Supports default values, scopes, and even encrypted fields. Example use case: If we need to toggle a ‘dark mode’ feature per user, we’d just add HasSettings to the User model and define public bool $dark_mode = false—no migrations or controllers needed. It’s a force multiplier for config-heavy features."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver