PHPackages                             renoki-co/laravel-yaml-config - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. renoki-co/laravel-yaml-config

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

renoki-co/laravel-yaml-config
=============================

The usual Laravel config files, but with one YAML. Write objects and arrays in your config without having to write ugly inline, JSON.

0.1.0(3y ago)741[4 PRs](https://github.com/renoki-co/laravel-yaml-config/pulls)Apache-2.0PHPCI passing

Since Nov 16Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/renoki-co/laravel-yaml-config)[ Packagist](https://packagist.org/packages/renoki-co/laravel-yaml-config)[ Docs](https://github.com/renoki-co/laravel-yaml-config)[ GitHub Sponsors](https://github.com/rennokki)[ RSS](/packages/renoki-co-laravel-yaml-config/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (6)Used By (0)

Laravel YAML Config
===================

[](#laravel-yaml-config)

[![CI](https://github.com/renoki-co/laravel-yaml-config/workflows/CI/badge.svg?branch=master)](https://github.com/renoki-co/laravel-yaml-config/workflows/CI/badge.svg?branch=master)[![codecov](https://camo.githubusercontent.com/7db944b10e0396e47740f180e0b42a04950e98372cc834fa2e924af1fad367c2/68747470733a2f2f636f6465636f762e696f2f67682f72656e6f6b692d636f2f6c61726176656c2d79616d6c2d636f6e6669672f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/renoki-co/laravel-yaml-config/branch/master)[![StyleCI](https://camo.githubusercontent.com/88b43d2e2241a3d67caa2b4f60329aed7cb540c059d87d66a610cfe8f42ead8c/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3530363839383939352f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/506898995)[![Latest Stable Version](https://camo.githubusercontent.com/e8bba13d8158a8acd48bdc4023c98449d8f6558f7ff2a8da4df6b363ddf02e23/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c61726176656c2d79616d6c2d636f6e6669672f762f737461626c65)](https://packagist.org/packages/renoki-co/laravel-yaml-config)[![Total Downloads](https://camo.githubusercontent.com/5e7c75cc66ac396e82cb81dbf8795c4b08a3f463340268cdb22cc7d44a63b135/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c61726176656c2d79616d6c2d636f6e6669672f646f776e6c6f616473)](https://packagist.org/packages/renoki-co/laravel-yaml-config)[![Monthly Downloads](https://camo.githubusercontent.com/25b290a6ca13a39a7681eec10ebb6d0380f36db1da8f156f90818b784657d1db/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c61726176656c2d79616d6c2d636f6e6669672f642f6d6f6e74686c79)](https://packagist.org/packages/renoki-co/laravel-yaml-config)[![License](https://camo.githubusercontent.com/8d67de787f0afd5d4fa1a184f044598aba3e7d29ac99a4c82f46d0c322b723ff/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c61726176656c2d79616d6c2d636f6e6669672f6c6963656e7365)](https://packagist.org/packages/renoki-co/laravel-yaml-config)

The usual Laravel config files, but with one YAML file. Write objects and arrays in your config without having to write ugly inline, JSON.

🚀 Installation
--------------

[](#-installation)

You can install the package via composer:

```
composer require renoki-co/laravel-yaml-config
```

Publish the config:

```
php artisan vendor:publish --provider="RenokiCo\LaravelYamlConfig\LaravelYamlConfigServiceProvider" --tag="config"
```

🙌 Usage
-------

[](#-usage)

This package makes sure you don't have to use inline-JSON in your .env files that would look like this:

```
AWS_CLUSTERS='[{"region": "us-east-1", "url": "..."}, {"region": "eu-west-1", "url": "..."}]'

// config/clusters.php
return [
    'aws' => env('AWS_CLUSTERS', json_encode([
        // create a default for it
    ])),
];
```

First, create a local `.laravel.yaml` file in your root Laravel project:

```
touch .laravel.yaml
```

Declare your configuration in YAML:

```
clusters:
  aws:
    - region: us-east-1
      url: https://...
    - region: eu-west-1
      url: https://...
  google:
    - region: europe-west1
      url: https://...
```

```
foreach (config('clusters.aws') as $cluster) {
    // $cluster['region']
}
```

You shouldn't commit your `.laravel.yaml` files to your code repo:

```
echo ".laravel.yaml\n.laravel.yml" >> .gitignore
```

Replacing nested variables
--------------------------

[](#replacing-nested-variables)

While the package lets you set arbitrary config without messing with ugly encoded JSON, you can still use it to update nested variables with already-existing configuration:

```
database:
  connectons:
    mysql:
      host: mysql
clusters:
  aws:
    # ...
```

Declaring defaults
------------------

[](#declaring-defaults)

While you shouldn't commit your `.laravel.yaml` file, you can commit a `.laravel.defaults.yaml` file that can contain defaults for specific configs you have declared:

```
touch .laravel.config.yaml
```

```
clusters:
  aws: []
  google: []
```

### Sequential lists

[](#sequential-lists)

Take extra caution when declaring defaults for lists of items:

```
# .laravel.defaults.yaml
clusters:
  - region: us-east-1
  - region: eu-west-1
```

When a config that contains lists that are pre-filled, with a `.laravel.yaml` like this, an odd behavior appears:

```
# .laravel.yaml
clusters:
  - region: ap-south-1
```

When you'd expect the final value of `clusters` to contain only one item, it will actually contain two items, with the first one being replaced instead:

```
// 'clusters' => [
//     ['region' => 'ap-south-1'],
//     ['region' => 'eu-west-1'],
// ]

dump(config('clusters'));
```

🐛 Testing
---------

[](#-testing)

```
vendor/bin/phpunit
```

🤝 Contributing
--------------

[](#-contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

🔒 Security
----------

[](#--security)

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

🎉 Credits
---------

[](#-credits)

- [Alex Renoki](https://github.com/rennokki)
- [All Contributors](../../contributors)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance54

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.2% 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

Unknown

Total

1

Last Release

1273d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21983456?v=4)[rennokki](/maintainers/rennokki)[@rennokki](https://github.com/rennokki)

---

Top Contributors

[![rennokki](https://avatars.githubusercontent.com/u/21983456?v=4)](https://github.com/rennokki "rennokki (18 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")

---

Tags

phplaravelconfigurationconfigyamlenvironmentenv

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/renoki-co-laravel-yaml-config/health.svg)

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

###  Alternatives

[northwoods/config

Simple configuration loader

1516.0k](/packages/northwoods-config)[romanpitak/nginx-config-processor

Nginx configuration files processor.

7235.3k1](/packages/romanpitak-nginx-config-processor)[thewunder/conphigure

Framework Agnostic Configuration Library

3115.9k](/packages/thewunder-conphigure)[phppkg/config

Config manage, load, get. Supports INI,JSON,YAML,NEON,PHP format file

133.5k](/packages/phppkg-config)

PHPackages © 2026

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