PHPackages                             codetech/laravel-model-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. codetech/laravel-model-settings

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

codetech/laravel-model-settings
===============================

A Laravel package that allows you to assign settings to your models.

v0.0.5-beta(6y ago)19MITPHPPHP ^7.2CI failing

Since Apr 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/CodeTechAgency/laravel-model-settings)[ Packagist](https://packagist.org/packages/codetech/laravel-model-settings)[ RSS](/packages/codetech-laravel-model-settings/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Laravel Model Settings
======================

[](#laravel-model-settings)

A Laravel package that allows you to assign settings to your models.

[![Latest version](https://camo.githubusercontent.com/f3b17eb4a70b9392d31753d620cc9bc4095aadc197494884860c148697b54b1a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f436f64655465636850742f6c61726176656c2d6d6f64656c2d73657474696e67733f7374796c653d666c61742d737175617265)](https://github.com/CodeTechPt/laravel-model-settings/releases)[![GitHub license](https://camo.githubusercontent.com/1f215027db2b188a7bf0060ab506f3b97b0498e639c80211e16003a551118e90/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f436f64655465636850742f6c61726176656c2d6d6f64656c2d73657474696e67733f7374796c653d666c61742d737175617265)](https://github.com/CodeTechPt/laravel-model-settings/blob/master/LICENSE)

Installation &amp; setup
------------------------

[](#installation--setup)

Add the package to your Laravel app using composer

```
composer require codetech/laravel-model-settings

```

For changing migrations and configurations, you will need to publish both files by running the following Artisan command:

```
php artisan vendor:publish --provider="CodeTech\ModelSettings\Providers\ModelSettingsServiceProvider"

```

### Service Provider

[](#service-provider)

Register the package's service provider in config/app.php. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled.

```
'providers' => [

    ...
    Codetech\ModelSettings\Providers\ModelSettingsServiceProvider::class,
    ...

];

```

### Migrations

[](#migrations)

Execute the next Artisan command to run the migrations.

```
php artisan migrate

```

Usage
-----

[](#usage)

Use the trait in your models.

```

use CodeTech\ModelSettings\Traits\HasSettings;

class Theme extends Model
{
    use HasSettings;

    ...

```

### Retrieve model settings

[](#retrieve-model-settings)

#### Querying the database

[](#querying-the-database)

```
// Get all settings
$settings = $theme->settings;

// Get settings from a specific scope
$scopedSettings = $theme->settings()->ofScope('colors')->get();

```

#### Using the config helper

[](#using-the-config-helper)

If you have load\_into\_memory enabled, you can access the settings with the config() helper.

```
config('theme.colors.primary');

```

---

License
-------

[](#license)

**codetech/laravel-model-settings** is open-sourced software licensed under the [MIT license](https://github.com/CodeTechPt/laravel-model-settings/blob/master/LICENSE).

About CodeTech
--------------

[](#about-codetech)

[CodeTech](https://www.codetech.pt) is a web development agency based on Matosinhos, Portugal. Oh, and we LOVE Laravel!

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

5

Last Release

2219d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6adaef8b30d5d0dee7bc2484fd9b0a9ad33e38afb78fc5d18d79d6239c811c76?d=identicon)[jfrosorio](/maintainers/jfrosorio)

---

Top Contributors

[![jfrosorio](https://avatars.githubusercontent.com/u/17640929?v=4)](https://github.com/jfrosorio "jfrosorio (9 commits)")

---

Tags

eloquent-modelslaravellaravel-packagepolymorphic-relationssettingslaravelSettingslaravel-packagelaravel-model-settingscodetecheloquent-modelspolymorphic-relations

### Embed Badge

![Health badge](/badges/codetech-laravel-model-settings/health.svg)

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

###  Alternatives

[realrashid/sweet-alert

Laravel Sweet Alert Is A Package For Laravel Provides An Easy Way To Display Alert Messages Using The SweetAlert2 Library.

1.2k2.9M21](/packages/realrashid-sweet-alert)[akaunting/laravel-setting

Persistent settings package for Laravel

495805.1k7](/packages/akaunting-laravel-setting)[imanghafoori/laravel-nullable

A package to help you write expressive defensive code in a functional manner

151423.7k6](/packages/imanghafoori-laravel-nullable)[fresns/plugin-manager

Enhance Laravel Apps: Organized &amp; Scalable

523.2k2](/packages/fresns-plugin-manager)

PHPackages © 2026

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