chapdel/settings
Add per-model settings to your Laravel app. Store settings in a JSON column, a dedicated table, or Redis via simple traits. Includes defaults plus helpers to get, set, check, remove, and persist settings on any Eloquent model.
UserSettings, AppSettings) promotes modularity and separation of concerns.config() (static) or packages like spatie/laravel-settings (more opinionated). This package offers lightweight, model-centric flexibility.settings table (migration provided) with model_type (polymorphic) and model_id (foreign key). Minimal schema changes if not already using polymorphic relations.$user->settings()->set('theme', 'dark')).SettingsUpdated events for reactivity.model_type + model_id composite index).config() or other sources may require custom logic.{'theme': 'dark', 'notifications': {'email': true, 'sms': false}} vs. normalized themes and notification_preferences tables.config())?User, Team). Minimal boilerplate.GET /settings/user/{id}).@php $theme = auth()->user()->settings->get('theme') @endphp).config/, hardcoded, or other packages).settings table.(model_type, model_id) and (key) for performance.AppSettings model (singleton pattern).// Migrate from config to AppSettings
$appSettings = AppSettings::firstOrNew();
$appSettings->set('api_endpoint', config('services.api.endpoint'));
$appSettings->save();
config() calls with the package’s methods where appropriate.// Before: config('app.theme')
// After: auth()->user()->settings->get('theme', config('app.default_theme'))
config() caching to avoid breaking changes).composer.json constraints).php config).spatie/laravel-activitylog (if adding audit logs).settings table or Settings model).\Chapdel\Settings\Settings).config() calls with the package.retrieved, saved, or deleted events.SettingsRepository for complex queries.User::settings()).model_type).Settings::logAccess()).settings table structure and indexes.model_type matches a valid model).How can I help you explore Laravel packages today?