PHPackages                             jooservices/laravel-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. [Database &amp; ORM](/categories/database)
4. /
5. jooservices/laravel-config

ActiveLibrary[Database &amp; ORM](/categories/database)

jooservices/laravel-config
==========================

Store and retrieve application configuration in database (MongoDB) with caching.

v1.4.0(3w ago)01.2k1[7 PRs](https://github.com/jooservices/laravel-config/pulls)2MITPHPPHP ^8.5CI passing

Since Mar 14Pushed 2w agoCompare

[ Source](https://github.com/jooservices/laravel-config)[ Packagist](https://packagist.org/packages/jooservices/laravel-config)[ RSS](/packages/jooservices-laravel-config/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (5)Dependencies (51)Versions (20)Used By (2)

JOOservices Laravel Config
==========================

[](#jooservices-laravel-config)

[![CI](https://github.com/jooservices/laravel-config/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/jooservices/laravel-config/actions/workflows/ci.yml)[![OpenSSF Scorecard](https://camo.githubusercontent.com/c950dbe21b9a83343821b6d69f6548c43014de9aab5bd4405e273a2aa6ae5174/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f6a6f6f73657276696365732f6c61726176656c2d636f6e6669672f6261646765)](https://securityscorecards.dev/viewer/?uri=github.com/jooservices/laravel-config)[![PHP Version](https://camo.githubusercontent.com/2788132aa1e54031a6c94edcbf8688566d3e18cb5492cd1766836f74a24b27b5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e352532422d626c75652e737667)](https://www.php.net/)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](./LICENSE)[![Packagist Version](https://camo.githubusercontent.com/6225946983418616dac320b85875fbf82fa246f2395308672b329fba0d34df60/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f6f73657276696365732f6c61726176656c2d636f6e666967)](https://packagist.org/packages/jooservices/laravel-config)

The JOOservices Laravel Config package stores Laravel application configuration in MongoDB and exposes typed runtime access through `JOOservices\\LaravelConfig\\Facades\\Config`.

Package name: `jooservices/laravel-config`

Install
-------

[](#install)

```
composer require jooservices/laravel-config
```

Publish configuration:

```
php artisan vendor:publish --tag=config-store-config
```

Requirements
------------

[](#requirements)

- PHP 8.5+
- Laravel 12 or 13 (CI-verified)
- Laravel 11 (constraint-compatible; not CI-verified due to testbench audit constraints)
- MongoDB via `mongodb/laravel-mongodb` ^5.4
- MongoDB PHP extension

What the package does
---------------------

[](#what-the-package-does)

- stores values as `group`, `key`, `value`, and `type` documents in MongoDB
- loads a full in-memory map on first read and optionally caches that map
- supports typed normalization for `string`, `int`, `float`, `bool`, `array`, `json`, and `null`
- provides runtime `get`, typed getters, `set`, `forget`, `remember`, `listOrdered`, `group`, `all`, `refresh`, and `fresh` operations
- ships Artisan commands for common operator tasks
- provides `Config::fake()` for consumer-app tests without MongoDB

Quick example
-------------

[](#quick-example)

```
use JOOservices\LaravelConfig\Facades\Config;

Config::set('system.site_name', 'XCrawler');
Config::set('system.enabled', true);
Config::set('payment.retry_times', 3);

$siteName = Config::get('system.site_name');
$system = Config::group('system');
$fresh = Config::fresh('system.site_name');
```

Path format and validation
--------------------------

[](#path-format-and-validation)

Paths must use the `group.key` format.

Rejected values include:

- empty paths
- missing dots
- leading dots
- trailing dots
- double dots
- empty group or empty key segments

Examples:

- valid: `system.site_name`
- valid: `payment.retry_times`
- invalid: `system`
- invalid: `.system.site_name`
- invalid: `system.`
- invalid: `system..site_name`

Cache and memory behavior
-------------------------

[](#cache-and-memory-behavior)

- `get`, `has`, `group`, and `all` load from memory first
- when memory is cold, the service reads the cached full map first, then MongoDB on cache miss
- `set` and `forget` update MongoDB, bump a shared cache version stamp, and refresh the cached full map within the current process
- when a loaded process detects a newer cache version stamp, it reloads from cache or MongoDB before serving reads
- `refresh` clears in-memory state and the configured cache key, then reloads from MongoDB
- `fresh` bypasses the in-memory map and cache for a direct MongoDB read
- stored `null` is returned as `null`; caller defaults are not applied when the key exists with a null value
- bool normalization uses PHP `filter_var(..., FILTER_VALIDATE_BOOLEAN)` semantics

Important limitations:

- the in-memory map is process-local, so long-running workers can hold stale in-memory state until `refresh()` is called or the process is recycled
- each mutation rewrites the full cached map; keep collections config-sized (hundreds of keys, not thousands)
- use a dedicated cache store/prefix in production; treat the shared cache as a trusted boundary

MongoDB index requirement
-------------------------

[](#mongodb-index-requirement)

Create a unique compound index on `group` and `key` so each config path remains unique.

```
php artisan config-store:ensure-index
```

Equivalent Mongo shell command:

```
db.configs.createIndex(
  { group: 1, key: 1 },
  { name: 'config_group_key_unique', unique: true }
);
```

Artisan commands
----------------

[](#artisan-commands)

```
php artisan config-store:get system.site_name --default="Default"
php artisan config-store:set system.site_name XCrawler
php artisan config-store:set system.enabled true --type=bool
php artisan config-store:forget system.site_name
php artisan config-store:list system --json
php artisan config-store:doctor
php artisan config-store:export storage/config-store.json
php artisan config-store:import storage/config-store.json --merge
php artisan config-store:refresh
php artisan config-store:ensure-index
```

Security note
-------------

[](#security-note)

This package can store sensitive values, but it does not encrypt stored values by default. Do not place credentials or secrets in this store unless your MongoDB deployment, backups, and access controls already satisfy your security requirements.

Upgrade note
------------

[](#upgrade-note)

The canonical namespace for this package is now `JOOservices\\LaravelConfig\\`. Existing code that imports `JooServices\\LaravelConfig\\...` must be updated. This repository does not currently ship a compatibility alias layer.

Documentation
-------------

[](#documentation)

Start with:

- [Documentation Hub](./docs/README.md)
- [Installation](./docs/01-getting-started/01-installation.md)
- [Quick Start](./docs/01-getting-started/02-quick-start.md)
- [Configuration](./docs/02-user-guide/01-configuration.md)
- [Usage Guide](./docs/02-user-guide/02-usage-guide.md)
- [Release Process](./docs/04-development/06-release-process.md)
- [Risks, Legacy, and Gaps](./docs/05-maintenance/01-risks-legacy-and-gaps.md)
- [Changelog](./CHANGELOG.md)

AI support
----------

[](#ai-support)

This repository includes AI contributor guidance and skill files.

Start with:

- [AGENTS.md](./AGENTS.md)
- [CLAUDE.md](./CLAUDE.md)
- [AI Skills Map](./ai/skills/README.md)
- [AI Skills Usage Guide](./ai/skills/USAGE.md)

Development
-----------

[](#development)

```
composer lint
composer lint:all
composer test
composer test:coverage
composer check
composer ci
```

MongoDB must be available for integration tests.

Community
---------

[](#community)

- [Contributing](./CONTRIBUTING.md)
- [Security Policy](./SECURITY.md)
- [License](./LICENSE)

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance96

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~30 days

Total

5

Last Release

26d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/142772948?v=4)[JOOservices Ltd](/maintainers/jooservices)[@jooservices](https://github.com/jooservices)

---

Top Contributors

[![soulevilx](https://avatars.githubusercontent.com/u/2688707?v=4)](https://github.com/soulevilx "soulevilx (24 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")

---

Tags

cacheconfigconfigurationjooserviceslaravellaravel-packagemongodbphpphp85runtime-configurationlaravelconfigurationconfigmongodb

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.9M109](/packages/mongodb-laravel-mongodb)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k1](/packages/mike-bronner-laravel-model-caching)[propaganistas/laravel-disposable-email

Disposable email validator

6023.2M7](/packages/propaganistas-laravel-disposable-email)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k16.3M149](/packages/laravel-pulse)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)

PHPackages © 2026

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