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

Config Laravel Package

league/config

Define and validate nested PHP configuration with strict schemas (via Nette Schema). Merge multiple config sources, apply defaults, enforce types/constraints, and read values using convenient dot notation. Ideal for robust, structured app and library config.

View on GitHub
Deep Wiki
Context7

layout: default title: Mutability description: When/how to update schemas and config values, and how to prevent others from doing so

Mutability

Thanks to lazy processing, you can define schemas and set user-provided values at any time and in any order. This can be very convenient in many cases, but you might have times where you'd like to provide a read-only version of the Configuration to ensure nobody else can modify it.

Read-Only Reader

To do this, simply call $config->reader(). This will return an object that only has the get() and exists() methods, preventing others from further modifying the configuration:

use League\Config\Configuration;

$config = new Configuration([/* ... */]);

$someOtherObject->setConfig($config->reader());

Because both the reader and the main Configuration implement ConfigurationInterface, you can type-hint against that anywhere you need to retrieve values but not necessarily modify things.

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.
mydnic/volet-feature-board-filament-plugin
wmde/email-address
refinery29/test-util
dees040/laravel-api-responses
teamzac/geocoder
ideatica/config-writer
keaton-php/pipe-dream
jacksonwebservices/laravel-user-suite
maksimru/conditional-laravel-debugbar
gismatul/nova-support-chat
gismatul/laravel-support-chat
networkrailbusinesssystems/oracle-api
alphabalex/messaging-made-easy
rawphp/warp
shootkiran/merobug
narakode/fineauth
numencode/wn-syncops-plugin
ibnnajjaar/mib-global-pay
refinery29/php-cs-fixer-config
parsnick/steak