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

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

grhone/laravel-settings
=======================

A Laravel package to add settings to your models.

v1.0.0(1y ago)026MITPHP

Since May 18Pushed 1y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Laravel Settings Package
========================

[](#laravel-settings-package)

A Laravel package to manage settings for any Eloquent model. This package allows you to attach settings to any model using the `HasSettings` trait, retrieve settings with default values, and delete settings.

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

[](#installation)

1. Install the package via Composer:

    ```
    composer require grhone/laravel-settings
    ```
2. Add the service provider to `config/app.php` if using Laravel version below 5.5:

    ```
    'providers' => [
        // Other service providers...
        Grhone\LaravelSettings\SettingsServiceProvider::class,
    ],
    ```
3. Publish the migration file:

    ```
    php artisan vendor:publish --provider="Grhone\LaravelSettings\SettingsServiceProvider" --tag="migrations"
    ```
4. Run the migrations:

    ```
    php artisan migrate
    ```

Usage
-----

[](#usage)

### Using the `HasSettings` Trait

[](#using-the-hassettings-trait)

To use settings with your Eloquent models, simply add the `HasSettings` trait to your model:

```
