Weave Code
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

Laminas Config Laravel Package

laminas/laminas-config

Abandoned Laminas library for managing application configuration. Provides config containers and utilities (e.g., reading/merging structured config) used across Laminas/Zend-style apps. No further development; see Laminas TSC minutes for details.

View on GitHub
Deep Wiki
Context7

The Factory

Laminas\Config\Factory provides the ability to load configuration files to an array or to a Laminas\Config\Config object. The factory has two purposes

  • Loading configuration file(s)
  • Storing a configuration file

Storage writes to a single file

Storing the configuration always writes to a single file. The factory is not aware of merged configuration files, and as such cannot split configuration to multiple files. If you want to store particular configuration sections to separate files, you should separate them manually.

Loading configuration files

The first example illustrates loading a single configuration file:

// Load a PHP file as array:
$config = Laminas\Config\Factory::fromFile(__DIR__ . '/config/my.config.php');

// Load an XML file as Config object; the second parameter, when true,
// casts the configuration to a Config instance:
$config = Laminas\Config\Factory::fromFile(__DIR__.'/config/my.config.xml', true);

The next example demonstrates merging multiple files; note that they are in separate formats!

$config = Laminas\Config\Factory::fromFiles([
    __DIR__.'/config/my.config.php',
    __DIR__.'/config/my.config.xml',
]);

Storing configuration

Sometimes you may want to write configuration to a file. To do this, use the factory's toFile() method:

$config = new Laminas\Config\Config([], true);
$config->settings = [];
$config->settings->myname = 'framework';
$config->settings->date   = '2012-12-12 12:12:12';

//Store the configuration
Laminas\Config\Factory::toFile(__DIR__ . '/config/my.config.php', $config);

//Store an array
$config = [
    'settings' => [
        'myname' => 'framework',
        'data'   => '2012-12-12 12:12:12',
    ],
];

Laminas\Config\Factory::toFile(__DIR__ . '/config/my.config.php', $config);
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport