PHPackages                             scriptoshi/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. scriptoshi/settings

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

scriptoshi/settings
===================

Flexible setting manager for scriptoshi based applications

1.0.0(1y ago)02MITPHP ^8.2

Since Nov 20Compare

[ Source](https://github.com/scriptoshi/settings)[ Packagist](https://packagist.org/packages/scriptoshi/settings)[ RSS](/packages/scriptoshi-settings/feed)WikiDiscussions Synced yesterday

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

Scriptoshi Settings
===================

[](#scriptoshi-settings)

**[Scriptoshi](https://www.scriptoshi.com) Scripts**

`scriptoshi/settings` is a flexible and powerful settings manager for Laravel Scriptoshi applications. This package allows you to easily manage configuration settings with support for caching, grouping, and dynamic retrieval.

Features
--------

[](#features)

- **Easily store and retrieve settings** in Scriptoshi Scripts.
- **Cache settings** for optimized performance.
- **Group settings** based on categories.
- **Supports multiple formats** for values (including JSON and booleans).
- **Simple facade-based API** for accessing settings.
- **Laravel 11+ compatible**.

---

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

[](#installation)

You can install the package via Composer:

```
composer require scriptoshi/settings
```

---

Configuration
-------------

[](#configuration)

Once installed, the package will automatically register the service provider.

You can publish the package's configuration file using the command:

```
php artisan vendor:publish --provider="Scriptoshi\Settings\SettingServiceProvider"
```

---

Usage
-----

[](#usage)

You can use the `Setting` facade or the `Settings` class directly to interact with your settings.

### Retrieving Settings

[](#retrieving-settings)

#### Get a single setting:

[](#get-a-single-setting)

```
use Scriptoshi\Settings\Facades\Setting;

$value = Setting::get('setting_name');
```

#### Get a setting with a default value:

[](#get-a-setting-with-a-default-value)

```
$value = Setting::get('setting_name', 'default_value');
```

#### Get all settings:

[](#get-all-settings)

```
$settings = Setting::all();
```

#### Get settings grouped by their group name:

[](#get-settings-grouped-by-their-group-name)

```
$groupedSettings = Setting::group();
```

#### Get settings by group:

[](#get-settings-by-group)

```
$groupSettings = Setting::for('group_name');
```

### Storing Settings

[](#storing-settings)

#### Store or update a single setting:

[](#store-or-update-a-single-setting)

```
Setting::set('setting_name', 'value');
```

#### Store multiple settings at once:

[](#store-multiple-settings-at-once)

```
Setting::set([
    'setting_1' => 'value1',
    'setting_2' => 'value2',
]);
```

### Caching Settings

[](#caching-settings)

Settings are cached by default to reduce database queries. You can manually refresh the cache with:

```
Setting::refresh();
```

---

Facade
------

[](#facade)

The package includes a `Setting` facade for easy usage. The following methods are available:

- `Setting::get($key, $default = null, $fresh = false)` – Retrieve a setting.
- `Setting::set($key, $value)` – Store or update a setting.
- `Setting::all($fresh = false)` – Retrieve all settings.
- `Setting::group($fresh = false)` – Retrieve settings grouped by their category.
- `Setting::for($group)` – Retrieve settings for a specific group.
- `Setting::json($group)` – Retrieve settings for a specific group as JSON.
- `Setting::has($key)` – Check if a setting exists.
- `Setting::remove($key)` – Remove a setting.
- `Setting::refresh()` – Refresh the cached settings.

---

Testing
-------

[](#testing)

### Unit Tests

[](#unit-tests)

Run the unit tests with PHPUnit:

```
vendor/bin/phpunit
```

The package includes unit and feature tests to ensure everything is working as expected.

---

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

[](#development)

1. **Clone the repository**:

    ```
    git clone https://github.com/scriptoshi/settings.git
    ```
2. **Install dependencies**:

    ```
    composer install
    ```
3. **Run tests**:

    ```
    vendor/bin/phpunit
    ```

---

License
-------

[](#license)

This package is licensed under the MIT License.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

590d ago

### Community

Maintainers

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

---

Top Contributors

[![ofumbi](https://avatars.githubusercontent.com/u/4081256?v=4)](https://github.com/ofumbi "ofumbi (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M983](/packages/statamic-cms)[code16/sharp

Laravel Content Management Framework

79164.7k8](/packages/code16-sharp)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[nunomaduro/laravel-starter-kit-inertia-react

The skeleton application for the Laravel framework.

2071.1k](/packages/nunomaduro-laravel-starter-kit-inertia-react)

PHPackages © 2026

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