PHPackages                             guyueyingmu/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. guyueyingmu/laravel-config-writer

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

guyueyingmu/laravel-config-writer
=================================

Laravel provider to be able to rewrite configuration

1.0.0(3y ago)14MITPHP

Since Dec 22Pushed 3y agoCompare

[ Source](https://github.com/guyueyingmu/laravel-config-writer)[ Packagist](https://packagist.org/packages/guyueyingmu/laravel-config-writer)[ RSS](/packages/guyueyingmu-laravel-config-writer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (6)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

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% 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 ~39 days

Total

5

Last Release

1445d ago

Major Versions

0.3.1 → 1.0.02022-05-28

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/d6161937e98d55045be9a86d8ab830d3050d664681e8e2b2ecc50f5064815cb0?d=identicon)[guyueyingmu](/maintainers/guyueyingmu)

---

Top Contributors

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

---

Tags

dima-bzzlaravel-config-writer

### Embed Badge

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

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

###  Alternatives

[underwear/laravel-vue-good-table

Vue-good-table wrapper for Laravel. Server side tables without pain.

4016.7k](/packages/underwear-laravel-vue-good-table)

PHPackages © 2026

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