qcod/laravel-app-settings
Add a database-backed settings manager with an admin UI to your Laravel app. Define settings sections/inputs in config, edit them via a Bootstrap 4 page (or custom CSS), and access values via the AppSettings facade. Settings are cached for zero SQL reads.
Start by installing the package via Composer: composer require qcod/laravel-app-settings. Next, publish the config file using php artisan vendor:publish --provider="QCod\AppSettings\AppSettingsServiceProvider" --tag="config", then run migrations to create the settings table. Define your first settings sections and inputs in config/app_settings.php (e.g., app_name, from_email) under the sections array. Finally, create a custom layout view that includes the settings partial (@include('app_settings::_settings')) and visit /settings (or your configured URL) to manage settings via the UI. Use the global helper setting('app_name', 'default') or the AppSettings facade to retrieve values elsewhere in your app.
setting_group closure in app_settings.php to isolate settings per user or tenant (e.g., return 'user_' . auth()->id();). For dynamic grouping at runtime, call app('app-settings')->setStorageGroup('dynamic-group') before setting/getting values.sections and inputs in app_settings.php to disable the UI while retaining DB persistence. Great for APIs. Remember to set 'remove_abandoned_settings' => false to prevent deletion of undefined keys.<select> options dynamically via closures, such as querying App\Models\City::pluck('name', 'id')—ideal for multi-tenant or context-aware options.window.App.settings object during layout rendering to enable reactive frameworks (e.g., Vue/React) to access config values without additional HTTP requests.custom_inputs config array to support new field types (e.g., datepickers, color pickers) while maintaining consistency with the built-in validation and rendering flow.setting()->set() or the UI will auto-invalidate the cache. Avoid manually caching setting() results unless you invalidate the cache explicitly after updates.rules field supports Laravel validation syntax (e.g., required|email|max:255). For complex rules, use closures to access runtime state (e.g., rules => function() { return request()->user()->isAdmin() ? 'required' : 'nullable'; }).image or file inputs, ensure your storage/app/public symlink exists (php artisan storage:link). For custom mutator logic, always delete previous file paths to avoid disk clutter.data_type (int, bool, array) to enforce casting on save and retrieval. Without it, values are stored as strings—causing unexpected behavior (e.g., '0' === false).'setting_page_view', 'controller') to integrate with admin panels (e.g., LaraCraft, Filament) or customize workflows without modifying the vendor code.How can I help you explore Laravel packages today?