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

ActiveLibrary

supplycart/settings
===================

Model settings for Laravel

3.0.0(1y ago)148.3k↓32.1%2[1 issues](https://github.com/supplycart/settings/issues)MITPHPPHP ^8.3

Since Jan 24Pushed 1y ago2 watchersCompare

[ Source](https://github.com/supplycart/settings)[ Packagist](https://packagist.org/packages/supplycart/settings)[ RSS](/packages/supplycart-settings/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (2)Versions (12)Used By (0)

Laravel Settings
================

[](#laravel-settings)

Allows eloquent models to have its own settings

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

[](#installation)

To install, run this on your Laravel installation:

```
composer require supplycart/settings
```

Then publish the migration file:

```
php artisan vendor:publish --tag=migrations --provider=Supplycart\Settings\Providers\SettingsServiceProvider
```

Usage
-----

[](#usage)

To use, you just need to implement the `Supplycart\Settings\Contracts\HasSettings` contract and use `Supplycart\Settings\Traits\HasSettings` trait:

```
use Supplycart\Settings\Contracts\HasSettings as HasSettingsContract;
use Supplycart\Settings\Traits\HasSettings;

class User extends Model implements HasSettingsContract
{
    use HasSettings;

    public function getDefaultSettings(): array
    {
        return [];
    }
}
```

### Methods

[](#methods)

#### getSetting($key, $default = null)

[](#getsettingkey-default--null)

Retrieve model setting by key. You can use dot notations to get nested setting e.g

```
$user->getSetting('timezone', 'Asia/Kuala_Lumpur');
$user->getSetting('lang', 'en_my');
$user->getSetting('subscription.newsletter', false);
```

#### setSetting($key, $value)

[](#setsettingkey-value)

Set model setting using key. You can use dot notation same like `getSetting` method e.g

```
$user->setSetting('timezone', 'UTC');
$user->setSetting('lang', 'en_us');
$user->setSetting('subscription.newsletter', true);
```

#### getSettings()

[](#getsettings)

Get all settings. It will return array of settings

```
$settings = $user->getSettings(); // ['timezone' => 'UTC', 'lang' => 'en_us', 'subscription' => ['newsletter' => true]];
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 70.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

Every ~201 days

Recently: every ~236 days

Total

9

Last Release

700d ago

Major Versions

v1.0.2 → 2.02021-11-18

2.0.4 → 3.0.02024-06-18

PHP version history (4 changes)v1.0.0PHP ^7.4

v1.0.2PHP ^7.4|^8.0

2.0PHP ^8.0

3.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/31958581e350190777ddc3903176db25650096d4594847f0ac6e8393b1bce9d7?d=identicon)[sc.super](/maintainers/sc.super)

---

Top Contributors

[![az-iar](https://avatars.githubusercontent.com/u/1249596?v=4)](https://github.com/az-iar "az-iar (12 commits)")[![iqrammm](https://avatars.githubusercontent.com/u/48657762?v=4)](https://github.com/iqrammm "iqrammm (3 commits)")[![zkri](https://avatars.githubusercontent.com/u/68538649?v=4)](https://github.com/zkri "zkri (2 commits)")

---

Tags

hacktoberfestlaravelsettings

### Embed Badge

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

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

PHPackages © 2026

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