Weave 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

Settings Laravel Package

ottosmops/settings

A lightweight Laravel settings package for storing key-value configuration in the database, with caching and simple helpers to get, set, and forget settings at runtime. Ideal for editable app settings that shouldn't live in config files.

View on GitHub
Deep Wiki
Context7

Just another laravel settings package

Frequently asked questions about Settings
How do I install ottosmops/settings in a Laravel project?
Install it with Composer using composer require ottosmops/settings. The package includes a Laravel service provider and facade integration, so Laravel's package discovery should register it automatically. You will also need to run the package migrations to create the settings table before reading or writing values.
Does ottosmops/settings support dot notation for nested settings?
Yes. The package supports dot-notation access for nested keys, so you can read and write values such as app.theme.color rather than managing flat key names manually. This makes it easier to group related runtime settings while still storing them in a simple key-value table.
How does caching work in ottosmops/settings?
ottosmops/settings includes a caching layer so repeated settings lookups do not hit the database on every request. When you set or forget a setting, the package should keep the cached values consistent with the stored database values. This is useful for settings that are read frequently but changed rarely.
Which Laravel versions does ottosmops/settings support?
The package is built for Laravel applications and integrates through a service provider and facade. Because supported Laravel and PHP versions can change between releases, check the composer.json constraints on Packagist or GitHub before installing in an older or newer Laravel project.
How do I return a default value when a setting does not exist?
Use the package's get helper with a fallback default value when the requested key is missing. This lets you avoid null checks throughout your application while still allowing settings to be overridden at runtime. Defaults are especially useful for optional UI or application behavior settings.
Can I store arrays, booleans, or integers with ottosmops/settings?
The package provides typed retrieval and default values, so you can request settings as the type your application expects. For complex values such as arrays, store them in a supported serialized form such as JSON and decode them after retrieval, or confirm the exact casting behavior in the package documentation.
How do I delete or forget a setting in ottosmops/settings?
Use the forget method with the setting key to remove a stored value. Dot notation should work there as well, so you can forget nested keys such as app.theme.color. After deletion, subsequent get calls will return the default value if one is provided.
Is ottosmops/settings fast enough for production use?
Yes, for typical editable application settings it is designed to be lightweight. The built-in caching layer avoids repeated database queries for values that are read often, while writes update the persistent store. As with any database-backed settings package, keep cache invalidation and write frequency in mind for high-traffic applications.
How is ottosmops/settings different from Laravel config or spatie/laravel-settings?
Laravel config files are best for deploy-time configuration that is not edited by users at runtime. ottosmops/settings is intended for editable key-value settings stored in the database with caching and a simple get/set API. spatie/laravel-settings is a more feature-rich alternative, while this package focuses on being lightweight and straightforward.
How do I test Laravel code that uses ottosmops/settings?
Use your normal Laravel testing setup with a test database and run the package migrations so the settings table exists. Set the required settings in each test before exercising the code under test, and clear or refresh the settings cache between tests if your test suite reuses the application instance. Because the package exposes a facade, you can also mock or swap the underlying implementation where appropriate.
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.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource