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
Laravel Settings

Laravel Settings Laravel Package

phu1237/laravel-settings

phu1237/laravel-settings is a Laravel package for managing dynamic application settings through a simple API. Define and retrieve persistent configuration values, organize settings for easier maintenance, and integrate them cleanly into Laravel applications.

View on GitHub
Deep Wiki
Context7

Global setting for laravel. Can use in controller, blade, etc.

Frequently asked questions about Laravel Settings
What is phu1237/laravel-settings used for?
It is a Laravel package for managing global, persistent application settings through a simple API instead of hardcoding values in config files. You define settings once, store them, and then read them from controllers, Blade views, service classes, or anywhere else in your application. It is useful for values that admins or non-developers need to change without a redeploy, such as site names, contact details, or feature toggles.
How do I install phu1237/laravel-settings?
Install it with Composer by running composer require phu1237/laravel-settings in your project root. The package's service provider is registered automatically through Laravel package discovery, so no manual provider entry is usually required. After installing, check the README on GitHub for any publish or migration steps needed for your version.
How do I read a setting value in a controller or Blade view?
The package exposes a simple retrieval API that works anywhere in your Laravel app, including controllers and Blade templates, and the same call is typically usable from both. Exact syntax depends on the version, so confirm whether it is a helper function or a facade in the README. For Blade, you can also pass values from a controller or view composer if you prefer to keep templates free of logic.
Does the package need a database table and migrations?
Because settings are persistent rather than stored in memory, they are normally kept in a database table created by a migration shipped with the package. Run php artisan migrate after installing and publishing any package assets. If your settings must survive between deployments, make sure the table is part of your normal database migration and backup workflow.
Can I organize settings into groups or namespaces?
Yes, the package is designed to let you group and structure settings so related values stay together and are easier to maintain. Organizing by feature or domain, such as mail settings versus storefront settings, keeps lookups readable and prevents key name collisions. Follow the key naming convention shown in the README so retrieval stays consistent across your codebase.
Which Laravel and PHP versions are supported?
Version support is defined by the require constraints in the package's composer.json, and the Laravel framework version is listed there alongside the PHP requirement. Check the Packagist page or the composer.json for the release you plan to install before upgrading Laravel. Pinning a compatible major version in composer.json helps you avoid surprises during framework upgrades.
How do I update a setting value at runtime?
Settings can be changed programmatically through the package's API, which is what makes them dynamic rather than static config values. A common pattern is to build a small admin screen that validates input and then saves the new value. Because the values live outside Laravel's config files, changing them does not require php artisan config:cache, but you should still clear any caching layer you add on top.
How do I test code that depends on settings?
Use Laravel's RefreshDatabase trait and seed or create the settings your test needs before exercising the code under test. If a test should not touch the database, consider resolving the settings service from the container and binding a fake implementation. Keeping settings retrieval behind a small wrapper class in your app also makes mocking and assertions much easier.
Are settings cached, and how does that affect performance?
Persistent settings are read from storage, so repeated lookups in a single request can add query overhead if the package does not cache them automatically. If that matters for your workload, read each setting once per request or wrap retrieval in Laravel's Cache facade with a sensible TTL. Always clear the cache when a setting is updated so users do not see stale values. Check the README for any built-in caching options before adding your own layer.
What are alternatives to phu1237/laravel-settings?
The best-known option is spatie/laravel-settings, which uses typed settings classes and is well suited to large applications with strong testing needs. Some teams prefer lighter database-backed helpers or simply storing JSON in a dedicated model. If your values only change at deploy time, Laravel's native config files plus environment variables are still the simplest choice.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo