PHPackages                             dima-bzz/laravel-config-writer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dima-bzz/laravel-config-writer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dima-bzz/laravel-config-writer
==============================

Laravel provider to be able to rewrite configuration

0.3.1(4y ago)01621MITPHPPHP ^7.4|^8.0

Since Dec 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/dima-bzz/laravel-config-writer)[ Packagist](https://packagist.org/packages/dima-bzz/laravel-config-writer)[ RSS](/packages/dima-bzz-laravel-config-writer/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (4)Dependencies (7)Versions (5)Used By (0)

Laravel Config Writer
=====================

[](#laravel-config-writer)

[![Latest Stable Version](https://camo.githubusercontent.com/ba160e51d0ce3637ae52730b61646f794247376ecbfc2e072d3df8ead3f22b6d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64696d612d627a7a2f6c61726176656c2d636f6e6669672d777269746572)](https://packagist.org/packages/dima-bzz/laravel-config-writer)[![Tests](https://github.com/dima-bzz/laravel-config-writer/workflows/Tests/badge.svg)](https://github.com/dima-bzz/laravel-config-writer/workflows/Tests/badge.svg)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/9e5e7591de7e2e5af8ad257d5134939af6284472aa355767980844f1e6817b67/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f64696d612d627a7a2f6c61726176656c2d636f6e6669672d7772697465722f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/dima-bzz/laravel-config-writer/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/03608f558a6694a095eb7d444d82cf059e9db2baa947b9d84697417f367b8e25/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64696d612d627a7a2f6c61726176656c2d636f6e6669672d777269746572)](https://packagist.org/packages/dima-bzz/laravel-config-writer)

Write to Laravel Config files and maintain file integrity.

This library adds the ability to write to configuration files.

You can rewrite array values inside a basic configuration file that returns a single array definition (like a Laravel config file) whilst maintaining the file integrity, leaving comments and advanced settings intact.

The following value types are supported for writing: strings, integers, booleans and arrays.

Support
-------

[](#support)

This provider is designed to be used in Laravel from `7.4 and 8.0` version.

Setup
-----

[](#setup)

Install through composer:

```
composer require "dima-bzz/laravel-config-writer"

```

Set a filename to use as default in the `.env` file:

```
...
CONFIG_WRITER=config
...

```

You can optionally publish the config file with:

```
php artisan vendor:publish --tag="config-writer"
```

After you've configured everything you should run the command `artisan config:clear` or `artisan config:cache`.

Introduction
------------

[](#introduction)

The default is strict write mode. If you wish, you can change it in the configuration file:

```
...
strict => false
...
```

Or through the Facade:

```
use DimaBzz\LaravelConfigWriter\Facades\ConfigWriter
...
ConfigWriter::of([
    'item' => 'new value',
    'nested.config.item' => 'value',
    'arrayItem' => ['Single', 'Level', 'Array', 'Values'],
    'numberItem' => 3,
    'booleanItem' => true
])
->strictMode(false)
->write();
...
```

Usage the helper
----------------

[](#usage-the-helper)

This is the easiest way to write new data to the config file:

```
config_writer([
    'item' => 'new value',
    'nested.config.item' => 'value',
    'arrayItem' => ['Single', 'Level', 'Array', 'Values'],
    'numberItem' => 3,
    'booleanItem' => true
]);
```

Set another config file optional:

```
config_writer('config-writer', [
    'item' => 'new value',
    'nested.config.item' => 'value',
    'arrayItem' => ['Single', 'Level', 'Array', 'Values'],
    'numberItem' => 3,
    'booleanItem' => true
]);
```

Usage the Facade
----------------

[](#usage-the-facade)

You can write new data to the config file like this:

```
...
ConfigWriter::write([
    'item' => 'new value',
    'nested.config.item' => 'value',
    'arrayItem' => ['Single', 'Level', 'Array', 'Values'],
    'numberItem' => 3,
    'booleanItem' => true
]);
...
```

Also, you can set certain parameters:

```
...
ConfigWriter::of([
    'item' => 'new value',
    'nested.config.item' => 'value',
    'arrayItem' => ['Single', 'Level', 'Array', 'Values'],
    'numberItem' => 3,
    'booleanItem' => true
])
->config('config-writer')
->strictMode(false)
->write();
...
```

Events
------

[](#events)

#### `DimaBzz\LaravelConfigWriter\Events\WriteSuccess`

[](#dimabzzlaravelconfigwritereventswritesuccess)

This event will be fired if writing to the configuration file was successful. It has the following public properties:

- `name`: configuration file name

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

1597d ago

PHP version history (2 changes)0.1.0PHP ^7.0|^8.0

0.2.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/64298b29d89d10df9f5aa0c705a7770968293a0c98d3e97a8bcff75fccaf092f?d=identicon)[dima-bzz](/maintainers/dima-bzz)

---

Top Contributors

[![dima-bzz](https://avatars.githubusercontent.com/u/8027583?v=4)](https://github.com/dima-bzz "dima-bzz (12 commits)")

---

Tags

dima-bzzlaravel-config-writer

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/dima-bzz-laravel-config-writer/health.svg)

```
[![Health](https://phpackages.com/badges/dima-bzz-laravel-config-writer/health.svg)](https://phpackages.com/packages/dima-bzz-laravel-config-writer)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[prologue/alerts

Prologue Alerts is a package that handles global site messages.

3486.1M30](/packages/prologue-alerts)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[illuminate/session

The Illuminate Session package.

9937.4M753](/packages/illuminate-session)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
