Download the PHP package diogo2550/database-system-setting without Composer

On this page you can find all versions of the php package diogo2550/database-system-setting. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package database-system-setting

# 🚀 Laravel Database System Settings [![Latest Version on Packagist](https://img.shields.io/packagist/v/diogo2550/database-system-setting.svg?style=flat-square)](https://packagist.org/packages/diogo2550/database-system-setting) [![Total Downloads](https://img.shields.io/packagist/dt/diogo2550/database-system-setting.svg?style=flat-square)](https://packagist.org/packages/diogo2550/database-system-setting) [![License](https://img.shields.io/packagist/l/diogo2550/database-system-setting.svg?style=flat-square)](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 Administrative panel for the database-system-setting created with FilamentPHP.

📌 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

📦 Installation

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

Next, publish the configuration files and the migration:

Finally, run the migrations to create the system_settings table:

⚙️ 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

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:

Syncing with the Database

After defining your schema, sync the information with the database. Existing values are always preserved!

Cleanup tip: Removed a setting from the code and want to delete it from the database? Use the --prune flag: php artisan database-system-setting:sync --prune

💻 Practical Usage

You don't need to learn a new syntax. Use the good old config() helper anywhere in your code: Controllers, Views (Blade), Middlewares, or Jobs.

🚀 The Cache Engine (Under the Hood)

Reading settings from the database on every request is the biggest performance mistake an application can make. Database System Settings solves this with a smart invalidatable cache flow:

  1. Application Boot: Laravel fetches the data from the database once and generates a cache with a 24-hour TTL.
  2. Subsequent Requests: Instant responses straight from the Cache (0 database queries).
  3. Automatic Invalidation: If you (or your Admin panel) perform an Update, Create, or Delete on the SystemSetting model, the package destroys the cache instantly. The next request rebuilds the cache with fresh data.

Customizing the Cache

Need to disable the cache in the local environment or change the expiration time? Just edit the __internal__ key in the config/settings.php file:


📊 Database Structure

For reference, the system_settings table generated by the migration has the following structure:

Column Type Functionality
id bigint Primary key.
key string Unique configuration key (e.g., site_name).
value text Stored value (natively supports JSON).
description text User-friendly description for admin panels.
schema json Validation rules and metadata.
updated_at timestamp Trigger for cache invalidation.

🤝 Contributing

Contributions are always welcome! If you have ideas to improve the package, feel free to open an Issue or submit a Pull Request.

📄 License

This project is open-source and licensed under the terms of the MIT License.


Made with ☕ and clean code by Diogo Alves

All versions of database-system-setting with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package diogo2550/database-system-setting contains the following files

Loading the files please wait ...