PHPackages                             macropage/laravel-json-settings - 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. [Caching](/categories/caching)
4. /
5. macropage/laravel-json-settings

ActiveLibrary[Caching](/categories/caching)

macropage/laravel-json-settings
===============================

Store your Laravel application settings in one or multiple JSON files.

v0.1.0(4y ago)24MITPHPPHP ^8.0

Since Feb 14Pushed 4y agoCompare

[ Source](https://github.com/michabbb/laravel-json-settings)[ Packagist](https://packagist.org/packages/macropage/laravel-json-settings)[ Docs](https://github.com/ryangjchandler/laravel-json-settings)[ GitHub Sponsors](https://github.com/ryangjchandler)[ RSS](/packages/macropage-laravel-json-settings/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (12)Versions (2)Used By (0)

Store your Laravel application settings in JSON files.
======================================================

[](#store-your-laravel-application-settings-in-json-files)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0c84ca0657a338306bf27e91c60d34f79038697ff491fbb0e1f643bc7ef3f2ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6163726f706167652f6c61726176656c2d6a736f6e2d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/macropage/laravel-json-settings)[![GitHub Tests Action Status](https://camo.githubusercontent.com/cd5b705fb1930c7634d8e27dba786cdd4e5a35169951abb2168506edd4db9c34/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d696368616262622f6c61726176656c2d6a736f6e2d73657474696e67732f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/michabbb/laravel-json-settings/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/91eb403a60c200095f004ed5ec55eda0f94ca5bccba003194f7016eb6c0c88e9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d696368616262622f6c61726176656c2d6a736f6e2d73657474696e67732f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/michabbb/laravel-json-settings/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/9411712b4bcb1d26d0317c850b9966620e09f50531b9e28d772c606dac04f9d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696368616262622f6c61726176656c2d6a736f6e2d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/macropage/laravel-json-settings)

This is a fork of
The main change is: I added namespaces that get saved into individual files.
I still don´t know if that is good idea, so let´s find out ;)

This package provides a simple `SettingsRepository` class that can be used to store your application's settings in a single JSON file.

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

[](#installation)

You can install the package via composer:

```
composer require macropage/laravel-json-settings
```

You can publish the config file with:

```
php artisan vendor:publish --tag="json-settings-config"
```

Usage
-----

[](#usage)

You can resolve an instance of `macropage\LaravelJsonSettings\SettingsRepository` from the container by type-hinting it in any DI-supported method, e.g. a controller method.

```
class IndexController
{
    public function __invoke(SettingsRepository $settings)
    {
        return view('index', [
            'title' => $settings->get('index.title'),
        ]);
    }
}
```

The `SettingsRepository` class contains the following methods:

- `get(string $key, mixed $default = null)` - retrieve the value of a setting by providing the key (dot-notation supported).
- `set(string $key, mixed $value, bool $save = true)` - set the value of a setting and toggle auto-save.
- `has(string $key)` - determine if a setting exists.
- `save()` - manually save your settings back to disk.
- `reload()` - clear the cache and reload the settings from disk.

If you prefer to use facades, you can interact with the `macropage\LaravelJsonSettings\Facades\Settings` facade directly too.

Testing
-------

[](#testing)

```
composer test
```

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Michael Bladowski](https://github.com/michabbb)
- [Ryan Chandler](https://github.com/ryangjchandler)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

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

1546d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ea63e34d79d9383a876c7c107f9175746dea8a8b48974a797e39430e135f16a8?d=identicon)[macropage](/maintainers/macropage)

---

Top Contributors

[![ryangjchandler](https://avatars.githubusercontent.com/u/41837763?v=4)](https://github.com/ryangjchandler "ryangjchandler (10 commits)")[![michabbb](https://avatars.githubusercontent.com/u/3524595?v=4)](https://github.com/michabbb "michabbb (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

cacheconfiglaravelpackagelaravelryangjchandlerlaravel-json-settings

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/macropage-laravel-json-settings/health.svg)

```
[![Health](https://phpackages.com/badges/macropage-laravel-json-settings/health.svg)](https://phpackages.com/packages/macropage-laravel-json-settings)
```

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[ryangjchandler/blade-cache-directive

Cache chunks of your Blade markup with ease.

202200.8k2](/packages/ryangjchandler-blade-cache-directive)[ryangjchandler/laravel-cloudflare-turnstile

A simple package to help integrate Cloudflare Turnstile.

438896.6k2](/packages/ryangjchandler-laravel-cloudflare-turnstile)[ryangjchandler/blade-capture-directive

Create inline partials in your Blade templates with ease.

8222.2M12](/packages/ryangjchandler-blade-capture-directive)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[ryangjchandler/laravel-comments

A dead-simple comments package for Laravel.

22118.2k](/packages/ryangjchandler-laravel-comments)

PHPackages © 2026

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