PHPackages                             geniusts/preferences - 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. [Admin Panels](/categories/admin)
4. /
5. geniusts/preferences

ActiveLibrary[Admin Panels](/categories/admin)

geniusts/preferences
====================

Very easy way to generate a preferences page for applications that have multiple components and packages.

2.4(2y ago)25.2k↓100%MITPHPPHP &gt;=7.0

Since Sep 9Pushed 2y ago2 watchersCompare

[ Source](https://github.com/GeniusTS/preferences)[ Packagist](https://packagist.org/packages/geniusts/preferences)[ RSS](/packages/geniusts-preferences/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (4)Versions (23)Used By (0)

Preferences page for Laravel
============================

[](#preferences-page-for-laravel)

This package to generate a preferences page to the application, specially if you have many component that have a different settings and you want to store it in the database and use it by default config functions of laravel.

- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

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

[](#installation)

1. ***Download the package***

- command line:

`composer require geniusts/preferences`

- or add it to composer file:

```
{
    "require": {
        "geniusts/preferences": "^2.0"
    }
}
```

and run: `composer update`

2. ***Service Provider***

- If you are using Laravel &gt;=5.5 and the `auto-discover` is enabled, no need to do anything.
- If your Laravel &lt;5.5 or you disabled `auto-discover` add the ServiceProvider to the providers array in `config/app.php`

```
    GeniusTS\Preferences\PreferencesServiceProvider::class,
```

**Note:** If you are using Laravel 5.5 or greater no need to add it, It will auto discove

3. ***Controller And Migrations***

Publish the package Controller file to your application. Run these commands:

```
php artisan vendor:publish --provider="GeniusTS\Preferences\PreferencesServiceProvider" --tag=controller

```

You can also publish views and migrations by the following commands:

```
php artisan vendor:publish --provider="GeniusTS\Preferences\PreferencesServiceProvider" --tag=views
php artisan vendor:publish --provider="GeniusTS\Preferences\PreferencesServiceProvider" --tag=migrations

```

No need to publish the migrations files just run migrate command to execute the migrations.

```
php artisan migrate

```

> If you want to use `DB` transaction while saving the data, add `protected $transactions = true;` to `SettingsController`.

4. ***Routes and views***

Add two routes to you routes file:

```
Route::get('/settings/{preferences_domain?}', 'SettingsController@edit')
    ->midllware(//Apply your middleware)

Route::patch('/settings/{preferences_domain?}/{preferences_element?}', 'SettingsController@update')
    ->midllware(//Apply your middleware)

```

Now you have to create a `preferences.settings` view with your app layout and include the `geniusts_preferences::settings` view.

```
@include('geniusts_preferences::settings');

```

Usage
-----

[](#usage)

### Creating settings tab

[](#creating-settings-tab)

1. ***create a view of the settings:***Ex.: `settings/general.blade.php`

```

                 Test

```

2. ***Register the tab to PreferencesManager***

```
    use GeniusTS\Preferences\Models\Domain;
    use GeniusTS\Preferences\Models\Element;

    // Create a settings Domain
    // Domain(string $key, View $view, string $label)
    // you can use label like 'labels.general', because the view execute "trans" function
    $domain = new Domain('general', view('settings.general'), 'General');

    // Add the inputs names and validation rules
    // Element(string $name, mixed $rules)
    $domain->addElement(new Element('project_name', 'required|max:255'));

    // OR for array values
    $domain->addElement(new Element('options', ['options' => 'array', 'options.*' => 'required|integer']));

    // register the Domain to the Preferences manager
    $manager = resolve('preferences'); // or app('preferences') for versions older than 5.3
    $manager->addDomain($domain);
```

> You can register the `domains` in the `boot` function of your package service provider.

### Access saved settings

[](#access-saved-settings)

Use the default `config` function or `Config` class to get the values of your settings: `config('preferences.{domain}.{element}')`

```
config('preferences.general.project_name');
```

Migration from version 1
------------------------

[](#migration-from-version-1)

1. update inputs name inside preferences views. Ex: You have a `general` domain that have `project_name` element, then the input name should be `general[project_name]`.
2. Update declaration of `edit` and `handleSuccessResponse` methods of `SettingsController` inside your project.

```
   public function edit($domain = null) {
        // Logic here
   }

    protected function handleSuccessResponse($domain, $element) {
        // Logic here
    }
```

License
-------

[](#license)

This package is free software distributed under the terms of the MIT license.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 97.9% 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 ~124 days

Recently: every ~297 days

Total

22

Last Release

910d ago

Major Versions

1.1.17 → 2.02020-08-11

PHP version history (2 changes)1.0PHP &gt;=5.6

2.0PHP &gt;=7.0

### Community

Maintainers

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

---

Top Contributors

[![aboudeh87](https://avatars.githubusercontent.com/u/10183425?v=4)](https://github.com/aboudeh87 "aboudeh87 (92 commits)")[![AmmarCodes](https://avatars.githubusercontent.com/u/351256?v=4)](https://github.com/AmmarCodes "AmmarCodes (2 commits)")

---

Tags

laravellaravel-5-packagelaravel-packagelaravel5laravelSettingspreferencesconfigurations

### Embed Badge

![Health badge](/badges/geniusts-preferences/health.svg)

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

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)[masterro/laravel-mail-viewer

Easily view in browser outgoing emails.

6392.1k](/packages/masterro-laravel-mail-viewer)[flat3/lodata

OData v4.01 Producer for Laravel

96320.9k](/packages/flat3-lodata)

PHPackages © 2026

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