PHPackages                             dvxgit-jalonzo/prototype-configuration - 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. dvxgit-jalonzo/prototype-configuration

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

dvxgit-jalonzo/prototype-configuration
======================================

Lightweight and flexible Laravel JSON configuration manager with dot notation support.

v1.0.1(3mo ago)03MITPHPPHP &gt;=8.0

Since Feb 7Pushed 3mo agoCompare

[ Source](https://github.com/dvxgit-jalonzo/prototype-configuration)[ Packagist](https://packagist.org/packages/dvxgit-jalonzo/prototype-configuration)[ RSS](/packages/dvxgit-jalonzo-prototype-configuration/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Prototype Configuration
=======================

[](#prototype-configuration)

[![Latest Version on Packagist](https://camo.githubusercontent.com/03090272a5c36e7dafbeac0e5f0f8d78459dd5b28ffc3666af9b66c665593287/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6476786769742d6a616c6f6e7a6f2f70726f746f747970652d636f6e66696775726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dvxgit-jalonzo/prototype-configuration)[![Total Downloads](https://camo.githubusercontent.com/7b121e2a878bd91cce7467c950bf0829ce31d8a832aed4e2024fe2207aa03769/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6476786769742d6a616c6f6e7a6f2f70726f746f747970652d636f6e66696775726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dvxgit-jalonzo/prototype-configuration)[![License](https://camo.githubusercontent.com/c8f62c135c0acbaa068ea8f5c86a765960d9a16358a664be0f452564359fd024/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6476786769742d6a616c6f6e7a6f2f70726f746f747970652d636f6e66696775726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dvxgit-jalonzo/prototype-configuration)

A lightweight and flexible Laravel package for managing JSON configuration files with dot notation support. Perfect for runtime configuration management without database overhead.

Features
--------

[](#features)

- 🚀 Simple and intuitive API
- 🎯 Dot notation support for nested values
- 📝 Read and write JSON configuration files
- 🔄 Batch operations with `setMany()`
- 🗑️ Easy key and array item removal
- ⚡ Zero database dependencies
- 🛡️ Type-safe with modern PHP

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

[](#installation)

```
composer require dvxgit-jalonzo/prototype-configuration
```

Quick Start
-----------

[](#quick-start)

### 1. Create a JSON configuration file

[](#1-create-a-json-configuration-file)

```
touch config/app-settings.json
```

```
{
  "app": {
    "name": "My Application",
    "version": "1.0.0",
    "maintenance": false
  },
  "features": {
    "newsletter": true,
    "analytics": false
  }
}
```

### 2. Use in your application

[](#2-use-in-your-application)

```
use Nrmnalonzo\Prototype\PrototypeConfiguration;

$config = new PrototypeConfiguration('app-settings.json');

// Get values
echo $config->get('app.name'); // "My Application"
echo $config->get('app.maintenance', false); // false (with default)

// Update values
$config->set('app.maintenance', true);
$config->set('features.newsletter', false);
```

Usage Examples
--------------

[](#usage-examples)

### Reading Configuration

[](#reading-configuration)

```
$config = new PrototypeConfiguration('settings.json');

// Get all configuration as array
$all = $config->all();

// Get specific value with dot notation
$appName = $config->get('app.name');

// Get with default value if key doesn't exist
$debug = $config->get('app.debug', false);

// Get nested values
$emailHost = $config->get('mail.smtp.host');
```

### Writing Configuration

[](#writing-configuration)

```
// Set a single value
$config->set('app.name', 'Updated App Name');

// Set multiple values at once (more efficient)
$config->setMany([
    'app.name' => 'My App',
    'app.version' => '2.0.0',
    'features.new_feature' => true,
]);

// Replace entire configuration
$config->replace([
    'app' => [
        'name' => 'Brand New App',
        'version' => '1.0.0'
    ]
]);
```

### Removing Configuration

[](#removing-configuration)

```
// Remove a key (supports dot notation)
$config->forget('app.debug');
$config->forget('features.old_feature');

// Remove specific array item by index
$config->forgetArrayItem('users', 0); // removes first user
```

Real-World Examples
-------------------

[](#real-world-examples)

### Feature Flags

[](#feature-flags)

```
$features = new PrototypeConfiguration('features.json');

if ($features->get('dark_mode.enabled')) {
    // Enable dark mode UI
}

// Toggle feature
$features->set('maintenance_mode', true);
```

### Application Settings

[](#application-settings)

```
$settings = new PrototypeConfiguration('settings.json');

// Update multiple settings
$settings->setMany([
    'timezone' => 'Asia/Manila',
    'locale' => 'en',
    'per_page' => 25,
]);
```

### Dynamic Configuration

[](#dynamic-configuration)

```
$config = new PrototypeConfiguration('runtime.json');

// Track application state
$config->set('last_backup', now()->toDateTimeString());
$config->set('total_users', User::count());
```

API Reference
-------------

[](#api-reference)

MethodDescription`all()`Get entire configuration as array`get(string $key, mixed $default = null)`Get value by key (supports dot notation)`set(string $key, mixed $value)`Set a single value`setMany(array $items)`Set multiple values at once`replace(array $data)`Replace entire configuration`forget(string $key)`Remove a key`forgetArrayItem(string $key, int $index)`Remove array item by indexRequirements
------------

[](#requirements)

- PHP 8.1, 8.2, or 8.3
- Laravel 11.x or 12.x

Error Handling
--------------

[](#error-handling)

The package throws a `RuntimeException` if the JSON file doesn't exist:

```
try {
    $config = new PrototypeConfiguration('nonexistent.json');
} catch (RuntimeException $e) {
    // Handle missing file
}
```

Tips
----

[](#tips)

- **File naming**: You can omit `.json` extension - it's added automatically

```
  new PrototypeConfiguration('settings'); // Same as 'settings.json'
```

- **Performance**: Use `setMany()` instead of multiple `set()` calls for better performance
- **Validation**: Consider adding validation before writing critical configuration

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

Security
--------

[](#security)

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

License
-------

[](#license)

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

Credits
-------

[](#credits)

- [Norman Jalonzo](https://github.com/dvxgit-jalonzo)
- [All Contributors](../../contributors)

---

**Made with ❤️ for the Laravel community**

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance81

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

100d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6225bfeeaaf5bad2bb4d762d642d62dbea3b87ff8430fe41092038cf201f5b34?d=identicon)[nrmnalonzo](/maintainers/nrmnalonzo)

---

Top Contributors

[![dvxgit-jalonzo](https://avatars.githubusercontent.com/u/135410823?v=4)](https://github.com/dvxgit-jalonzo "dvxgit-jalonzo (2 commits)")

---

Tags

jsonlaravelconfigurationconfig

### Embed Badge

![Health badge](/badges/dvxgit-jalonzo-prototype-configuration/health.svg)

```
[![Health](https://phpackages.com/badges/dvxgit-jalonzo-prototype-configuration/health.svg)](https://phpackages.com/packages/dvxgit-jalonzo-prototype-configuration)
```

###  Alternatives

[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[m1/vars

Vars is a simple to use and easily extendable configuration loader with in built loaders for ini, json, PHP, toml, XML and yaml/yml file types. It also comes with in built support for Silex and more frameworks to come soon.

69124.2k1](/packages/m1-vars)[ultrono/laravel-sitemap

Sitemap generator for Laravel 11, 12 and 13

36412.6k6](/packages/ultrono-laravel-sitemap)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[garf/laravel-conf

Store additional configs in JSON or Database (write, read)

246.4k](/packages/garf-laravel-conf)[thewunder/conphigure

Framework Agnostic Configuration Library

3115.9k](/packages/thewunder-conphigure)

PHPackages © 2026

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