PHPackages                             mbsoft31/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mbsoft31/settings

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

mbsoft31/settings
=================

This is my package settings

0.0.3(1y ago)033MITPHPPHP ^8.2

Since Nov 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mbsoft31/settings)[ Packagist](https://packagist.org/packages/mbsoft31/settings)[ Docs](https://github.com/mbsoft31/settings)[ GitHub Sponsors]()[ RSS](/packages/mbsoft31-settings/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (4)Used By (0)

Settings Package for PHP
========================

[](#settings-package-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/15652d82ca3458d0effd4dcf52054748b345c79bc000d2a1ab3611cb3985f716/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d62736f667433312f73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mbsoft31/settings)
[![GitHub Tests Action Status](https://camo.githubusercontent.com/6cf8ce007fc5c976a913f3a0afb602e89fe919c18e16ca7bf46493b489a3c214/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d62736f667433312f73657474696e67732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/mbsoft31/settings/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://camo.githubusercontent.com/9c6f1cdaec1ae61efef89842052bf384cdb2d136e2fbfcfec706a78e2c07bb71/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d62736f667433312f73657474696e67732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/mbsoft31/settings/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)
[![Total Downloads](https://camo.githubusercontent.com/2fd294a51cba056dabe1db649d60529f09a86566b9058fcb153e1156ced6c68b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d62736f667433312f73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mbsoft31/settings)

Introduction
------------

[](#introduction)

This package provides a simple and extensible way to manage application settings in various formats like JSON and YAML. It's designed to work seamlessly with Laravel and allows saving, loading, and managing configuration settings easily.

Features
--------

[](#features)

- Save and load application settings in JSON or YAML formats.
- Easily extendable for additional formats.
- Works out of the box with Laravel.
- Configurable storage paths.

---

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

[](#installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

You can install the package using Composer:

```
composer require mbsoft31/settings
```

### Step 2: Publish Configuration &amp; Migrations

[](#step-2-publish-configuration--migrations)

Publish the migrations and configuration files:

```
php artisan vendor:publish --tag="settings-migrations"
php artisan migrate

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

The configuration file (`config/settings.php`) will look like this:

```
return [
    // Define default paths or custom settings here
];
```

Optionally, you can publish views using:

```
php artisan vendor:publish --tag="settings-views"
```

---

Usage
-----

[](#usage)

### Example: Save and Load JSON Settings

[](#example-save-and-load-json-settings)

Here's a quick example of how to use the package to manage your application settings:

```
use MBsoft\Settings;

// Initialize settings
$settings = new Settings([
    'app.name' => 'My Application',
    'app.env' => 'local',
]);

// Save settings to a file
$settings->saveToFile(storage_path('settings.json'), \MBsoft\Settings\ConfigFormat::JSON);

// Load settings from a file
$loadedSettings = Settings::loadFromFile(storage_path('settings.json'), \MBsoft\Settings\ConfigFormat::JSON);

echo $loadedSettings->get('app.name'); // Outputs: "My Application"
```

---

Testing
-------

[](#testing)

Run the test suite using the following command:

```
composer test
```

To ensure the directory structure for file-based tests is correctly created during CI or local development, the package includes setup logic in the tests.

---

Advanced Usage
--------------

[](#advanced-usage)

### Supported Formats

[](#supported-formats)

Currently, the package supports:

- JSON
- YAML

You can extend the package to support additional formats by adding new serialization and deserialization methods.

### Custom Configuration

[](#custom-configuration)

You can modify the `settings.php` config file to define default file paths or application-specific settings.

---

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

[](#contributing)

We welcome contributions! Please see the [CONTRIBUTING](CONTRIBUTING.md) guide for details.

---

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

[](#security-vulnerabilities)

If you discover any security-related issues, please report them via the [Security Policy](../../security/policy).

---

Changelog
---------

[](#changelog)

Refer to the [CHANGELOG](CHANGELOG.md) for recent updates.

---

Credits
-------

[](#credits)

- [Mouadh Bekhouche](https://github.com/mbsoft31)
- [All Contributors](../../contributors)

---

License
-------

[](#license)

This package is open-source software licensed under the [MIT License](LICENSE.md).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

3

Last Release

541d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/288f14daea877ea6b5b49d25bf1647f75eab2870b3e143e2a35b17a0666f1bd8?d=identicon)[mbsoft](/maintainers/mbsoft)

---

Top Contributors

[![mbsoft31](https://avatars.githubusercontent.com/u/14237661?v=4)](https://github.com/mbsoft31 "mbsoft31 (15 commits)")

---

Tags

laravelSettingsMouadh Bekhouche

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mbsoft31-settings/health.svg)

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[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)

PHPackages © 2026

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