PHPackages                             t-labs-co/config-walker - 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. t-labs-co/config-walker

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

t-labs-co/config-walker
=======================

The helper config package for Laravel applications. That centralizes different config sources

1.0.1(11mo ago)12[4 PRs](https://github.com/T-Labs-Co/config-walker/pulls)MITPHPPHP ^8.4||^8.3||^8.2CI passing

Since Mar 22Pushed 1mo agoCompare

[ Source](https://github.com/T-Labs-Co/config-walker)[ Packagist](https://packagist.org/packages/t-labs-co/config-walker)[ Docs](https://github.com/t-labs-co/config-walker)[ GitHub Sponsors](https://github.com/ty-huynh)[ RSS](/packages/t-labs-co-config-walker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (14)Versions (7)Used By (0)

The Laravel Package config-walker
=================================

[](#the-laravel-package-config-walker)

[![Latest Version on Packagist](https://camo.githubusercontent.com/aaeab31509bbc240a466262b99b780de4de0801c54e4ced04451b2f39f45be08/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f742d6c6162732d636f2f636f6e6669672d77616c6b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/t-labs-co/config-walker)[![GitHub Tests Action Status](https://camo.githubusercontent.com/8b4fb8236e95418e3cb8fdf237ff82748705285d603d2a1fca22296479157ff7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f742d6c6162732d636f2f636f6e6669672d77616c6b65722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/t-labs-co/config-walker/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/0b61c666d0fe771d0d7f0758cc77139e241e1575e12d8a5740a9fae70cf1e087/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f742d6c6162732d636f2f636f6e6669672d77616c6b65722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/t-labs-co/config-walker/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/936821296ad13ebc5528319dc3d1db728d978088ebeba66918d695ac57e3d25f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f742d6c6162732d636f2f636f6e6669672d77616c6b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/t-labs-co/config-walker)

This package helps you grab all your data, like **database tables, enum, constants, hard code array, files or settings**, and turns it into a nice, organized hub. It's super handy for keeping things clean and avoiding copy-paste, so you can grab what you need quickly and cut down on extra coding.

Work with us
------------

[](#work-with-us)

We're PHP and Laravel whizzes, and we'd love to work with you! We can:

- Design the perfect fit solution for your app.
- Make your code cleaner and faster.
- Refactoring and Optimize performance.
- Ensure Laravel best practices are followed.
- Provide expert Laravel support.
- Review code and Quality Assurance.
- Offer team and project leadership.
- Delivery Manager

Features
--------

[](#features)

- Centralize different config sources into a single hub.
- Support for database tables, enums, constants, hard-coded arrays, files, and settings.
- Easy integration with Laravel models and enums.
- Customizable configuration options.
- Helper functions for accessing and managing configurations.
- Automatically load configurations with Laravel's config system.

PHP and Laravel Version Support
-------------------------------

[](#php-and-laravel-version-support)

This package supports the following versions of PHP and Laravel:

- PHP: `^8.2`
- Laravel: `^11.0`, `^12.0`

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require t-labs-co/config-walker
```

You can publish the config file with:

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

Usage
-----

[](#usage)

#### With Model

[](#with-model)

Using Model trait `TLabsCo\ConfigWalker\ConfigWalkable` and custom your `walkable` method

```
// Your Model App\Models\Category
class Category extends Model
{
    use HasFactory;
    use ConfigWalkable;

    // omit the rest

    // Export book category to config
    public function walkable(): array
    {
        return self::query()
            ->whereStatus(CategoryStatus::Published)
            ->whereType(CategoryType::Book)
            ->get()
            ->keyBy('slug')
            ->map(function ($cat) {
                return $cat->name;
            })
            ->toArray();
    }

    public function walkerKey(): string
    {
        return "category_" . CategoryType::Book->value;
    }
}

// Using TLabsCo\ConfigWalker\Facades\ConfigWalker to walk your model
ConfigWalker::walk(Category::class);

// Get the key config with Category
ConfigWalker::get('category_book');

// walk your config Category with Override key and under Tag
ConfigWalker::walk(Category::class, 'book1', 'categories');

// Combine your custom config under Tag
ConfigWalker::walk(['fantasy' => 'Fantasy'], 'book1', 'categories');

// Get config instance under tag categories
$categoriesConfig = ConfigWalker::tag('categories');
// Get custom config key
$categoriesConfig->get('book1');
// Get all
$categoriesConfig->all();
```

#### With Enum

[](#with-enum)

Using Enum trait `TLabsCo\ConfigWalker\EnumConfigWalkable` and custom your `walkable` method

```
// Enum class
enum CategoryType: string
{
    use EnumConfigWalkable;

    case Post = 'post';
    case Product = 'product';
    case Book = 'book';
    case Page = 'page';
}

// Using TLabsCo\ConfigWalker\Facades\ConfigWalker to walk your Enum with TLabsCo\ConfigWalker\EnumConfigWalkable

ConfigWalker::walk(CategoryType::class);

// Get data from enum CategoryType, by default the key will be dashed case from enum name and without namespace
// For here '\App\Enums\CategoryType' to 'category_type'
ConfigWalker::get('category_type');
```

#### Helper

[](#helper)

Using helper function to access config walker - like Laravel built-in `config()`

```
// Get Facade TLabsCo\ConfigWalker\Facades\ConfigWalker
config_walker()

// Get config key
config_walker('your-key');

// Set data when input array
config_walker(['your-key' => 'your-value']);
```

#### Use to access Laravel config

[](#use-to-access-laravel-config)

This package provide serveral ways to load with Laravel config

```
// Load on fly or from your boot ServiceProvider to auto load from init
ConfigWalker::loadDefault();

// Setting in config-walker.php option
return [
    'loadWithAppConfig' => true
]

// Using default laravel config via ConfigWalker
ConfigWalker::tag('default')->get('key');
// Or
ConfigWalker::makeDefault()->get('key');

// By default the Laravel will place under `default` group
// so to get key from config
config('key')
// equal to
config_walker('default.key')
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

Contributing
------------

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [T.](https://github.com/ty-huynh)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance75

Regular maintenance activity

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.9% 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 ~79 days

Total

2

Last Release

334d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b8096712a46f142a708061822c0644b806cd1000cb5499e408c6b11b12f6a899?d=identicon)[t-labs-co](/maintainers/t-labs-co)

---

Top Contributors

[![ty-huynh](https://avatars.githubusercontent.com/u/1597540?v=4)](https://github.com/ty-huynh "ty-huynh (17 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

config-walkerhelperlaravelpackagephpt-labs-colaravelconfigurationT.Labs Co.T.Labs and Co.config-walker

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/t-labs-co-config-walker/health.svg)

```
[![Health](https://phpackages.com/badges/t-labs-co-config-walker/health.svg)](https://phpackages.com/packages/t-labs-co-config-walker)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M626](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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