PHPackages                             diogo2550/database-system-setting - 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. [Database &amp; ORM](/categories/database)
4. /
5. diogo2550/database-system-setting

ActiveLibrary[Database &amp; ORM](/categories/database)

diogo2550/database-system-setting
=================================

Um simples plugin para abstrair o uso de configurações do sistema com o banco de dados.

v1.0.0(2mo ago)3130↓44.4%MITPHPPHP ^8.0

Since May 1Pushed 2mo agoCompare

[ Source](https://github.com/Diogo2550/database-system-setting)[ Packagist](https://packagist.org/packages/diogo2550/database-system-setting)[ RSS](/packages/diogo2550-database-system-setting/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

🚀 Laravel Database System Settings
==================================

[](#-laravel-database-system-settings)

[![Latest Version on Packagist](https://camo.githubusercontent.com/af6af5f54823be7793429de5d1cf97c3344aee45951423b37594adb72aed0992/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64696f676f323535302f64617461626173652d73797374656d2d73657474696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/diogo2550/database-system-setting)[![Total Downloads](https://camo.githubusercontent.com/161c03718e3251efa866ca3e2733b501fc8c098b25917163c94a2576800457c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64696f676f323535302f64617461626173652d73797374656d2d73657474696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/diogo2550/database-system-setting)[![License](https://camo.githubusercontent.com/181bc9df9db0da56e2c6fd791f2aaa1845dcec059ff18acf877adb26f463a42c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64696f676f323535302f64617461626173652d73797374656d2d73657474696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/diogo2550/database-system-setting)

**Dynamic database settings without sacrificing performance or your Developer Experience (DX).**

**Database System Settings** is an elegant Laravel package that solves a classic problem: how to give end-users (or administrators) control over settings without losing the framework's native features.

[![drawing](https://camo.githubusercontent.com/eeb625c43eea094b30542eb207cee2970692614ec2b3bd4f1d8f0bf9168d5c24/68747470733a2f2f692e696d6775722e636f6d2f644549436f63472e706e67)](https://camo.githubusercontent.com/eeb625c43eea094b30542eb207cee2970692614ec2b3bd4f1d8f0bf9168d5c24/68747470733a2f2f692e696d6775722e636f6d2f644549436f63472e706e67)Administrative panel for the database-system-setting created with FilamentPHP.

📌 Why use this package?
-----------------------

[](#-why-use-this-package)

In traditional Laravel applications, we rely on `.env` or static files in `config/` to manage global variables. But what happens when you need to change the number of items displayed on the homepage, enable/disable an ad network, or change an API key **without needing to deploy or access the server**?

This package brings the best of both worlds: the flexibility of a database with the speed and predictability of native config files.

It's the perfect tool to integrate with modern admin panels (like **FilamentPHP**), allowing you to build amazing configuration interfaces in minutes.

### ✨ Highlighted Features

[](#-highlighted-features)

- **👨‍💻 Flawless DX:** Native Autocomplete support in your IDE through the [official Laravel extension](https://marketplace.visualstudio.com/items?itemName=laravel.vscode-laravel). Forget the need to memorize database keys.
- **⚡ Performance First:** Smart and automatic caching. Your settings are loaded from the database *only once* and kept in cache. The database is only queried again when a setting is changed.
- **🔄 Elegant Synchronization:** Intuitive Artisan commands to sync, create, and prune orphan settings based on your schema.
- **🛠️ Zero Friction:** Continue accessing your data exactly as you always have: `config('settings.my_key')`.

📦 Installation
--------------

[](#-installation)

Installation is quick and straightforward. Start by requiring the package via Composer:

```
composer require diogo2550/database-system-setting
```

Next, publish the configuration files and the migration:

```
php artisan vendor:publish --tag=database-system-setting
```

Finally, run the migrations to create the `system_settings` table:

```
php artisan migrate
```

⚙️ How Configuration Works
--------------------------

[](#️-how-configuration-works)

The package's architecture is based on two main files published in your `config/` folder:

1. **`settings.php`**: Where keys are mapped to ensure your IDE (VS Code, PhpStorm) can provide perfect autocomplete via `config()`.
2. **`settings-schema.php`**: (Optional, but recommended) The heart of your validation. Here you define types, default values, and rules for your variables.

### Building your Schema

[](#building-your-schema)

The Schema is where you define the behavior and boundaries of your variables. Below is an example focused on a real application that needs to manage content rotation and monetization:

```
