New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

vluzrmos/eloquent-settings

An Eloquent Settings Repository
61 3

Larablocks Analysis

vluzrmos/eloquent-settings works with Laravel 5 (latest release v1.0.0, May 14, 2019), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 5, past end of life
  • No release in the last 12 months (last: May 14, 2019)
  • 0 downloads a month (needs 10,000)
  • 3 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: May 14, 2019.
  • No releases in the last 12 months.
  • First released: Dec 29, 2015.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.

Install
composer require vluzrmos/eloquent-settings
Latest Version:v1.0.0
PHP:>=7.0.0
Laravel:5
License:MIT
Last Updated:May 14, 2019
Links: GitHub  ·  Packagist
Maintainer: vluzrmos

Eloquent Settings Repository

A package to store settings of your application on database.

Installation

composer require vluzrmos/eloquent-settings

Configuration

First, you have to publish the configs and migrations:

php artisan vendor:publish --provider=Vluzrmos\EloquentSettings\Providers\EloquentSettingsServiceProvider

Second, run the migrations:

php artisan migrate

Usage

You can use the dependency injection or the setting helper:

use \Vluzrmos\EloquentSettings\Setting;

class YourInjectableClass {
   
   protected $settings;
   
   public function __construct (Setting $settings) {
       $this->settings = $settings;   
   }
   
   public function theMethod() {
       $option = $this->settings->get('my.awesome.option', 'default-value');
   }
} 
    

It's more easy to use the setting helper:

// Getter
$option = setting('my.awesome.option', 'default-value');
//or
$option = setting()->get('my.awesome.option', 'default-value');

// Setter
setting()->set('my.awesome.option', 'That is Awesome!');

setting()->save(); //remember, without this the settings will not be stored on database

Setting API

get(string key, mixed default=null) : mixed - Get a setting on database, if doens't exists it will use the default value.

set(string|array key, mixed value=null) : void - Set a value or array of key=>values to the settings.

forget(string key) : void - Clear an value of the settings.

has(string key) : bool - Check if settings has a given key.

all() : array - Get an array of all settings.

except(string|array keys ...) : array - Get settings which doesn't match with that given keys.

only(string|array keys ...) : array - Get settings which match with that given keys.

save() : void - IMPORTANT! Store settings on the database.

update(string|array keys, mixed value=null) : void - Sets and saves one or more settings.

Related Packages

sofa/hookable

Laravel Eloquent hooks system.

2,059,111 64
volosyuk/simple-eloquent

Adaptation of eloquent for retrieving its attributes

119,868 55
gzero/eloquent-tree

Eloquent Tree is a tree model for Laravel Eloquent ORM.

59,893 131
martinbean/laravel-sluggable-trait

A trait you can apply to Eloquent models to have slugs automatically generated o...

49,246 24
isswp101/elasticsearch-eloquent

Elasticsearch functionality like Laravel Eloquent models.

26,254 112

Version History

Version Released PHP Laravel License
v1.0.0 >=7.0.0 >=5.5.0 MIT
v0.0.2 ~5.0 MIT
v0.0.1 ~5.0 MIT