Download the PHP package dvxgit-jalonzo/prototype-configuration without Composer
On this page you can find all versions of the php package dvxgit-jalonzo/prototype-configuration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dvxgit-jalonzo/prototype-configuration
More information about dvxgit-jalonzo/prototype-configuration
Files in dvxgit-jalonzo/prototype-configuration
Package prototype-configuration
Short Description Lightweight and flexible Laravel JSON configuration manager with dot notation support.
License MIT
Informations about the package prototype-configuration
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
- 🚀 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
Quick Start
1. Create a JSON configuration file
2. Use in your application
Usage Examples
Reading Configuration
Writing Configuration
Removing Configuration
Real-World Examples
Feature Flags
Application Settings
Dynamic Configuration
API Reference
| Method | Description |
|---|---|
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 index |
Requirements
- PHP 8.1, 8.2, or 8.3
- Laravel 11.x or 12.x
Error Handling
The package throws a RuntimeException if the JSON file doesn't exist:
Tips
-
File naming: You can omit
.jsonextension - it's added automatically -
Performance: Use
setMany()instead of multipleset()calls for better performance - Validation: Consider adding validation before writing critical configuration
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Security
If you discover any security-related issues, please email the author instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
Credits
- Norman Jalonzo
- All Contributors
Made with ❤️ for the Laravel community